0

i'm trying to use upstart so that supervisord starts automatically at boot. my supervisord is in a virtual environment.

I've configured it to run in foreground mode with -n param and it works if started manually but refuses to start on boot.

Following the guide here http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count

I'm discovering that supervisord forks 37 times.

> ~/projects/bleh_app$ sudo strace -o /tmp/strace.log -fFv /home/bleh/py_venvs/supe/bin/supervisord -c /home/bleh/projects/bleh_app/supervisord/supervisord.conf &
[1] 5662

> ~/projects/bleh_app$ ps -ef | grep strace
root      5662  5447  0 21:02 pts/0    00:00:00 sudo strace -o /tmp/strace.log -fFv /home/bleh/py_venvs/supe/bin/supervisord -c /home/bleh/projects/bleh_app/supervisord/supervisord.conf
root      5663  5662 36 21:02 pts/0    00:00:03 strace -o /tmp/strace.log -fFv /home/bleh/py_venvs/supe/bin/supervisord -c /home/bleh/projects/bleh_app/supervisord/supervisord.conf
bleh     5703  5447  0 21:02 pts/0    00:00:00 grep --color=auto strace

> ~/projects/bleh_app$ sudo killall -9 strace
[1]+  Exit 137                sudo strace -o /tmp/strace.log -fFv /home/bleh/py_venvs/supe/bin/supervisord -c /home/bleh/projects/bleh_app/supervisord/supervisord.conf

> ~/projects/bleh_app$ sudo egrep "\<(fork|clone)\>\(" /tmp/strace.log | wc | awk '{print $1}'
37

Some questions:
* Any ideas as to why it won't start in forground mode on boot?
* Am I determining number of forks correctly?
* any better suggestions on how to start supervisord with upstart?

1 Answer 1

2

oh man...
I started down this path from here:
How to automatically start supervisord on Linux (Ubuntu)
and specifically this answer https://serverfault.com/a/115259/60345

"oh awesome upstart for supervisord.... nooooooo problem"

nope. Can get supervisord to start manually no problem, but cannot make it start automatically on boot. Debugging it seems like supervisord starts but then is instantly sent SIGTERM to kill itself. Don't know if it is because running in foreground.
The above question was originally to see if i could run it with expect fork or daemon (which i never figured out)

8 hours of my life later i find this
http://upstart.ubuntu.com/cookbook/#runlevels

you basically want your upstart conf file to look like:

description     "supervisord"

start on (filesystem and static-network-up)
stop on runlevel [!2345]

respawn

exec /<path to>/supervisord -n -c /<path to>/supervisord.conf

of particular note:
stop on runlevel [!2345]
vs
stop on runlevel [!345]

I wanted to post this answer in the other thread, but it is locked =(

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .