I installed upstart on a Debian 7.8 system, but last I checked this didn't work on an Ubuntu 11 system either. I've got my jobs running using sudo, but would like to do it right if possible. here's my .conf file:
start on stopped RUNLEVEL=[2345]
stop on runlevel [!2345]
setuid newuser
respawn
pre-start exec logger "pre-start JOB $JOB in HOME $HOME"
script
logger "start JOB $JOB in HOME $HOME"
echo "DEBUG start: `env`" >> /tmp/$JOB_env.log
timeout 360m $HOME/scripts/$JOB.py \
>/tmp/$JOB.log 2>&1 || mail -s "error in $JOB.conf" \
me@my.com < /tmp/$JOB.log
end script
post-stop exec sleep 60
the logger calls complete and yield:
Mar 7 15:56:13 vps39987 logger: pre-start JOB in HOME
Mar 7 15:56:13 vps39987 logger: start JOB in HOME
/tmp contains no *_env.log, and /var/log/upstart/ contains no file for $JOB.
I get emails with subject error in .conf
and containing timeout: failed to run command '/scripts/.py': No such file or directory
any ideas? I'm stumped.
[note: I commented out the setuid
line and still no joy]