[ https://issues.apache.org/jira/browse/OOZIE-3320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16590246#comment-16590246 ]
Andras Piros commented on OOZIE-3320: ------------------------------------- [~roeyshemtov24] thanks for the updated patch! Some propositions: * test {{ShellActionExecutor#resolveExecutable()}} separately * check in {{ShellActionExecutor#resolveExecutable()}} whether the {{exec}} is really present and is a file * let's not modify the existing license header of {{ShellActionExecutor}} - pre-commit hook takes a predefined template to check against * document the existing and new functionality in {{DG_ShellActionExtension.twiki}} describing both ways > Oozie ShellAction should support absolute bash file path > -------------------------------------------------------- > > Key: OOZIE-3320 > URL: https://issues.apache.org/jira/browse/OOZIE-3320 > Project: Oozie > Issue Type: Improvement > Components: action > Affects Versions: 5.0.0, 4.3.1 > Reporter: Roey Shem Tov > Assignee: Roey Shem Tov > Priority: Major > Labels: patch > Attachments: OOZIE-3086.patch, OOZIE-3320.patch > > > bash files that saved on shared mount, cannot be execute by the ShellAction > in proper way. > Example: > Worker-1,Worker-2,Worker-3 have shared mount /mnt/hadoop > on /mnt/hadoop there is a file script.sh > Right now there is two options to submit it using ShellAction: > # Upload it to hdfs, add it as a file and submit script.sh > # use bash as exec and file location (/mnt/hadoop/script.sh) as argument > (e.g <exec>bash>/exec><argument>/mnt/hadoop/script.sh</argument> > Best option is that the <exec> command will support shared mounted file : > <exec>/mnt/hadoop/script.sh</exec> > > This code is taking only the file name instead it full path: > {code:java} > String exec = actionXml.getChild("exec", ns).getTextTrim(); > String execName = new Path(exec).getName(); > actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName); > {code} > > Best option to support shared mount file is to support file:// starting for > bash files that are local (or shared by mount), e.g: > {code:java} > String exec = actionXml.getChild("exec", ns).getTextTrim(); String execName; > String localFilePrefix = "file://"; > // When exec starts with 'file://' refer it as local file. > if (exec.startsWith(localFilePrefix)) > execName = exec.substring(localFilePrefix.length()); > else execName = new Path(exec).getName(); > actionConf.set(ShellMain.CONF_OOZIE_SHELL_EXEC, execName); > {code} > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)