Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems.
Official introduction: http://supervisord.org/introduction.html
Install python
Reference: Python Source Releases
Version 2.7
Install pip
Reference: pip Installation
1 | wget 'https://bootstrap.pypa.io/get-pip.py' |
Install Supervisor
Reference: Supervisor Installing
1 | sudo pip install supervisor |
Config Supervisor
Create default configure file
1 | sudo mkdir -p /etc/supervisor/conf.d |
Change supervisord.conf
[include]
to :
1 | [include] |
Add worker configure file
Example /etc/supervisor/conf.d/example.conf
1 | [program:program name] |
Start Supervisor
Start supervisordsupervisord -c /etc/supervisor/supervisord.conf
When configure file have updated
1 | supervisorctl reread |
Basic operation
1 | supervisorctl status |
Running supervisord Automatically on Startup
Reference:
Setup init script.
Create /etc/rc.d/init.d/supervisord
with the following content, configure line 19 [prefix] and line 20 [config_path] as needed (I don’t know who’s the owner of this script, but thanks all the same):
1 | #!/bin/sh |
Make the script executable and register it as a service.
1 | sudo chmod +x /etc/rc.d/init.d/supervisord |