Supervisord Basics
November 24, 2010
supervisord is a system for starting and stopping processes on Unix boxes.
Installing
To install on Debian (assuming python setuptools are installed):
# easy_install supervisor
Once it has installed, run echo_supervisord_conf
at a command prompt to get an example config file. You can then redirect this to /etc/supervisord.conf to get a default config file.
# echo_supervisord_conf > /etc/supervisord.conf
Configuring
As an example configuration, add the following into /etc/supervisord.conf
:
[program:foo] command=/bin/cat
This is simple configuration that the program cat
will be run whenever supervisord starts.
Starting
To start supervisord, just run it at a root prompt:
# supervisord
You can then use the ctl command to list processes:
# supervisorctl foo RUNNING pid 5490, uptime 0:00:19 supervisor> exit
Web Interface
To enable the web interface, edit /etc/supervisord.conf, uncomment the inet_http_server
section and listen on *:9001
[inet_http_server] port=*:9001
You can now navigate to host:9001 from any local machine and see a list of processes that are running. You can also stop them, so be sure to secure this if required!