[ 
https://issues.apache.org/jira/browse/YARN-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13614922#comment-13614922
 ] 

rainy Yu commented on YARN-157:
-------------------------------

I can't commit Attachments. My patch is:
Index: 
src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
===================================================================
--- 
src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java  
    (revision 90765)
+++ 
src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java  
    (working copy)
@@ -140,8 +140,8 @@
   // Main class to invoke application master
   private String appMasterMainClass = "";

-  // Shell command to be executed 
-  private String shellCommand = ""; 
+  // Shell command to be executed. the Linux shell command '/bin/sh' is default
+  private String shellCommand = "/bin/sh"; 
   // Location of shell script
   private String shellScriptPath = "";
   // Args to be passed to the shell command
@@ -276,10 +276,11 @@
     appMasterMainClass = cliParser.getOptionValue("class",
         
"org.apache.hadoop.yarn.applications.distributedshell.ApplicationMaster");

-    if (!cliParser.hasOption("shell_command")) {
-      throw new IllegalArgumentException("No shell command specified to be 
executed by application master");
+    if (cliParser.hasOption("shell_command")) {
+      //throw new IllegalArgumentException("No shell command specified to be 
executed by application master");
+       shellCommand = cliParser.getOptionValue("shell_command");
     }
-    shellCommand = cliParser.getOptionValue("shell_command");
+    //shellCommand = cliParser.getOptionValue("shell_command");

     if (cliParser.hasOption("shell_script")) {
       shellScriptPath = cliParser.getOptionValue("shell_script");

                
> The option shell_command and shell_script have conflict
> -------------------------------------------------------
>
>                 Key: YARN-157
>                 URL: https://issues.apache.org/jira/browse/YARN-157
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: applications/distributed-shell
>    Affects Versions: 2.0.1-alpha
>            Reporter: Li Ming
>              Labels: patch
>
> The DistributedShell has an option shell_script to let user specify a shell 
> script which will be executed in containers. But the issue is that the 
> shell_command option is a must, so if both options are set, then every 
> container executor will end with exitCode=1. This is because DistributedShell 
> executes the shell_command and shell_script together. For example, if 
> shell_command is 'date' then the final command to be executed in container is 
> "date `ExecShellScript.sh`", so the date command will treat the result of 
> ExecShellScript.sh as its parameter, then there will be an error. 
> To solve this, the DistributedShell should not use the value of shell_command 
> option when the shell_script option is set, and the shell_command option also 
> should not be mandatory. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to