Linux – How to automatically start supervisord on Linux (Ubuntu)

daemonlinuxpythonsupervisord

Supervisord does not come with an init script or does not indicate how to get it started automatically, ie. after a reboot. I've tried some user-contributed /etc/init.d scripts, but they all fail.

What would be the preferred solution ?

Best Answer

Actually, I found one that works here http://gist.github.com/176149. To install it:

sudo curl https://gist.github.com/howthebodyworks/176149/raw/88d0d68c4af22a7474ad1d011659ea2d27e35b8d/supervisord.sh > /etc/init.d/supervisord

to run it

sudo chmod +x /etc/init.d/supervisord

and to automatically schedule it, do

sudo update-rc.d supervisord defaults

Make ensure correct pid in /etc/supervisord.conf which is mapped in /etc/init.d/supervisord

example: pidfile=/var/run/supervisord.pid

Stop and Start work properly

service supervisord stop
service supervisord start