0

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]

1 Answer 1

0

while I still don't know why $JOB isn't being expanded, I found by using for line in $(env); do logger env $line; done in the script stanza that $UPSTART_JOB is being set. I solved the missing $HOME variable in another way specific to my client's setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.