Attila Sasvari created OOZIE-3086:
-------------------------------------

             Summary: Oozie shell action ignores absolute path
                 Key: OOZIE-3086
                 URL: https://issues.apache.org/jira/browse/OOZIE-3086
             Project: Oozie
          Issue Type: Bug
          Components: action
    Affects Versions: 4.3.0, 4.2.0, 4.0.1, 4.1.0, 4.0.0, 3.3.2, 3.3.1, 3.3.0, 
3.2.0, 3.1.3, trunk
            Reporter: Attila Sasvari


[ShellActionExecutor's setupActionConf() method| 
https://github.com/apache/oozie/blob/883c7556d2f302261eae5aec6e323a5b1de04f74/core/src/main/java/org/apache/oozie/action/hadoop/ShellActionExecutor.java#L57]
 retrieves only the *basename* for the shell script specified by the user.
{code}
    Configuration setupActionConf(Configuration actionConf, Context context, 
Element actionXml, Path appPath)
    {
...
        String exec = actionXml.getChild("exec", ns).getTextTrim();
        String execName = new Path(exec).getName();
        actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName);
{code}

As a result, {{ShellMain}} will 
[execute|https://github.com/apache/oozie/blob/883c7556d2f302261eae5aec6e323a5b1de04f74/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/ShellMain.java#L356]
 the default command available in $PATH.
{code}
    protected String getExec(Configuration actionConf) {
        String exec = actionConf.get(CONF_OOZIE_SHELL_EXEC);
{code}

Consequences:
- This behaviour makes it also hard/impossible to use custom executable at a 
given location (that is available on each node where a shell action can run, 
for example a specific python version).
- Even if a user specifies a wrong path (e.g. a non-existing {{/usr/bn/id}}) on 
purpose to force failure of a shell action, the command might succeed with no 
apparent reason.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to