Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ubuntu upstart not respawning the daemon despite respawn in the config file

Tags:

upstart

I have problems with my deamon restart. upstart is not spawning the daemon when the daemon crashes. here is my upstart init file . pls advise.

description "bezkon watch dog"



start on runlevel [2345]

stop on runlevel  [!2345]

respawn

expect fork

script

        logger -s "Bezkon watch dog booting ..."

        logger -s "Waiting for engine to complete booting sleeping for 60 seconds "

        sleep 300

        export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

        export LUA_PATH=$LUA_PATH:/usr/local/bezkon/

        export LUA_CPATH=$LUA_CPATH:/usr/local/bezkon/

        chdir /usr/local/bezkon;

end script

exec /usr/local/bezkon/bezkon_dog >> /var/log/bezkon_crash.log 2>&1
like image 286
Ravikumar Tulugu Avatar asked Nov 05 '22 21:11

Ravikumar Tulugu


1 Answers

I don't think you can use script and exec together. Try pre-start script instead. Or put the exec line inside the script stanza. Not sure how this works together with expect fork though.

EDIT: Take a look at this bug comment by Scott Remnant, the lead Upstart dev. It looks like it would apply to your config file, and it doesn't appear that it has been fixed yet. I still think you might want to try pre-start script, or experiment with expect daemon vs. expect fork vs. nothing. Assuming you haven't done this already, it can't hurt.

like image 51
Tim Yates Avatar answered Dec 12 '22 04:12

Tim Yates