title: restart service crontab problem
body: <p>if i run the script below manually from putty (as root) then the service is restarted no problem</p>
  
  <h2>manual command</h2>
  
  <pre><code>sh /home/auser/server/reService.sh &gt;&gt; /var/log/reService.log
  </code></pre>
  
  <p>But if the same script is scheduled as a cronjob, also under root:</p>
  
  <h2>crontab command</h2>
  
  <pre><code>00 07 * * * /home/auser/server/reService.sh 2&gt;&amp;1 &gt;&gt; /var/log/reService.log
  </code></pre>
  
  <p>then the 'service myService restart' is not executed successfully: service is not restarted, and no command output in scheduled log compared to manual log. I can also tell you that nothing after the restart line executes if scheduled. </p>
  
  <p>Why, am I missing some privileges when going through crontab? How can i successfully schedule restarting of myService?</p>
  
  <p>thanks ahead. </p>
  
  <h2>reService.sh</h2>
  
  <pre><code>#!/bin/bash
  clear
  echo "============================================================================="
  echo "Daily restarting of my service"
  date
  echo "============================================================================="
  service myService restart
  exit 0
  </code></pre>
  
  <h2>manual log</h2>
  
  <pre><code> [H [J=============================================================================
  Daily restarting of my service
  Thu May 19 04:51:12 EDT 2011
  =============================================================================
  Stopping myService   ..done
  Starting myService   ..done
  </code></pre>
  
  <h2>scheduled log</h2>
  
  <pre><code>=============================================================================
  Daily restarting of my service
  Thu May 19 07:00:02 EDT 2011
  ============================================================================= 
  </code></pre>