> On 2011-12-05 18:40:43, Alejandro Abdelnur wrote: > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/client/src/main/resources/shell-action-0.1.xsd, > > line 34 > > <https://reviews.apache.org/r/3000/diff/2/?file=61824#file61824line34> > > > > env vars setting is missing, this is quite important when using shells. > > > > we should be able to specify multiple ENV vars, with one of the two > > syntaxes: > > > > <env-var>VAR=VALUE</env-var> > > > > or > > > > <environment> > > <variable> > > <name>VALUE</name> > > <value>VALUE</value> > > </variable> > > </environment> > > > > Mohammad Islam wrote: > I considered that also an option. So user can specify it here and oozie > will add it to oozie.launcher.mapred.child.env. > I will add that. > In addition, currently, User could still add the env directly through > oozie.launcher.mapred.child.env. > > Alejandro Abdelnur wrote: > I don't think these ENV settings should affect the launcher ENV, these > ENV settings are exclusively for the SHELL it will be executed by the > launcher. > > If the user wants to alter the launcher ENV for some reason, they always > can do it with the oozie.launcher.mapred.child.env, but by definition, > anything that is oozie.launcher.* is not propagated to the action itself. > > Mohammad Islam wrote: > My use case is as follows: > 1. <file>myscr.sh</file> > 2. <exec>myscr.sh<exec> > > In this case, if Oozie LM executes the command, it will not find the > executable "myscr.sh" because PATH variable doesn't contain CWD(.). > However, if it is like <exec>./myscr.sh<exec>, it will work. That means > user has to give the full path of the executable. How can a user configure > this through PATH variable. > > > Alejandro Abdelnur wrote: > well adding current dir to launcher process path PATH would do. just that. > > but still i'd argue that unix users are use to do the ./SCRIPT thingy as > current dir is commonly not in the PATH. > > Else, we could in the ShellMain to look at the script name and if does > not start with './' prepend it > > Mohammad Islam wrote: > It is not always current dir in the path. It could be <archive> that > could expand to a different directory. So in that case, the exec will be > <MY_TAR>/script.sh. So pre-appending might not work. > > > Another thing, in addition to PATH, do we need to add LD_LIBRARY_PATH > (for C++ exec), java.library.path(for java exec). I didn't test those > use-cases. > > So I will add **only** PATH to child.env. Others, I will check. > > Otherwise all env should be pass through <environment> section. > For implementation, what is the best way of passing these env/variables. > Can think of the followings: > Option 1: Use the same concept of args. For example args.0=var1, > args.1=value1, etc... > Option 2: Pass the whole environment section as value and parse it in the > ShellMain. (Not a good approach) > >
if yo are using archive, the path is not the TAR name but the the directory in the expanded TAR, as the expansion happens in CWD, the './' should work. What am I missing here? For ENV passing, it should be one element per VAR, you don't want to get into parsing there. - Alejandro ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3000/#review3624 ----------------------------------------------------------- On 2011-12-04 08:05:24, Mohammad Islam wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/3000/ > ----------------------------------------------------------- > > (Updated 2011-12-04 08:05:24) > > > Review request for oozie. > > > Summary > ------- > > More context at JIRA OOZIE-578. > > > This addresses bug OOZIE-578. > https://issues.apache.org/jira/browse/OOZIE-578 > > > Diffs > ----- > > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java > 1209346 > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/client/src/main/resources/shell-action-0.1.xsd > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/JavaActionExecutor.java > 1209346 > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/ShellActionExecutor.java > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/main/java/org/apache/oozie/action/hadoop/ShellMain.java > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/main/resources/oozie-default.xml > 1209346 > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/ShellTestCase.java > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellMain.java > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/docs/src/site/twiki/DG_ShellActionExtension.twiki > PRE-CREATION > > http://svn.apache.org/repos/asf/incubator/oozie/trunk/docs/src/site/twiki/index.twiki > 1209346 > > Diff: https://reviews.apache.org/r/3000/diff > > > Testing > ------- > > > Thanks, > > Mohammad > >
