title: Oozie shell script action
body: <p>I am exploring the capabilities of Oozie for managing Hadoop workflows. I am trying to set up a shell action which invokes some hive commands. My shell script hive.sh looks like:</p>
  
  <pre><code>#!/bin/bash
  hive -f hivescript
  </code></pre>
  
  <p>Where the hive script (which has been tested independently) creates some tables and so on. My question is where to keep the hivescript and then how to reference it from the shell script. </p>
  
  <p>I've tried two ways, first using a local path, like <code>hive -f /local/path/to/file</code>, and using a relative path like above, <code>hive -f hivescript</code>, in which case I keep my hivescript in the oozie app path directory (same as hive.sh and workflow.xml) and set it to go to the distributed cache via the workflow.xml.</p>
  
  <p>With both methods I get the error message:
  <code>"Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]"</code> on the oozie web console. Additionally I've tried using hdfs paths in shell scripts and this does not work as far as I know.</p>
  
  <p>My job.properties file:</p>
  
  <pre><code>nameNode=hdfs://sandbox:8020
  jobTracker=hdfs://sandbox:50300   
  queueName=default
  oozie.libpath=${nameNode}/user/oozie/share/lib
  oozie.use.system.libpath=true
  oozieProjectRoot=${nameNode}/user/sandbox/poc1
  appPath=${oozieProjectRoot}/testwf
  oozie.wf.application.path=${appPath}
  </code></pre>
  
  <p>And workflow.xml:
  </p>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;shell xmlns="uri:oozie:shell-action:0.1"&gt;
  
      &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
  
      &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
  
      &lt;configuration&gt;
  
          &lt;property&gt;
  
              &lt;name&gt;mapred.job.queue.name&lt;/name&gt;
  
              &lt;value&gt;${queueName}&lt;/value&gt;
  
          &lt;/property&gt;
  
      &lt;/configuration&gt;
  
      &lt;exec&gt;${appPath}/hive.sh&lt;/exec&gt;
  
      &lt;file&gt;${appPath}/hive.sh&lt;/file&gt; 
  
      &lt;file&gt;${appPath}/hive_pill&lt;/file&gt;
  
  &lt;/shell&gt;
  
  &lt;ok to="end"/&gt;
  
  &lt;error to="end"/&gt;
  
  &lt;/action&gt;
  
  &lt;end name="end"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>My objective is to use oozie to call a hive script through a shell script, please give your suggestions.</p>