All notes
Supervisord

Installation

In CentOS, run

yum info supervisor

NOTE: supervisor doesn't support python3!

Usage

Reference:

commands: "supervisord" and "supervisorctl".

Config files in order:

supervisord.conf is a Windows-INI-style (Python ConfigParser) file. This github repo gives a good init config file for supervisord.

Options

supervisord -c ${PWD}/supervisord.conf -i "uwsgi" -d /path/to/app/ -l /tmp/log/supervisord.log -j /tmp/supervisord-uwsgi.pid

Directives

redirect_stderr

If true, cause the process' stderr output to be sent back to supervisord on its stdout file descriptor (in UNIX shell terms, this is the equivalent of executing /the/program 2>&1).

Example

The following example comes from: Collabspot.

[program:uwsgi-emperor]
# Don't forget to create the /var/log/uwsgi/ folder for the uWSGI logs.
# Again, depending on your permissions, you might need to change its user:group to www-data.
command=/usr/local/bin/uwsgi --emperor "/var/www/*/conf/uwsgi.ini" --die-on-term --master --uid www-data --gid www-data --logto /var/log/uwsgi/emperor.log
autostart=true
autorestart=true
redirect_stderr=true

FAQ

Error: .ini file does not include supervisord section

ServerFault. The supervisord.conf file must contain a section named [supervisord] in which global settings related to the supervisord process should be inserted.