Deploying and Configuring Supervisor for Reliable Background Process Management on Linux
This guide walks through installing Supervisor from source, resolving dependencies, creating configuration files, defining custom program entries, starting the service, reloading configurations, and using supervisorctl to monitor and control processes on a Linux server.
When you need certain programs or processes to run stably in the background, server crashes or accidental termination can cause instability; the Supervisor process‑management tool provides a practical solution.
1. Install from source
Download the tarball, extract it, and run the Python installer:
[root@node2 ~]# cd supervisor-3.3.4
[root@node2 supervisor-3.3.4]# ll
[root@node2 supervisor-3.3.4]# python setup.py installThe installation fails with:
No local packages or download links found for meld3>=0.6.5
error: Could not find suitable distribution for Requirement.parse('meld3>=0.6.5')Resolve the issue by upgrading/installing meld3 and then re‑run the installer.
Verify the installation:
[root@node2 ~]# echo_supervisord_conf2. Configuration file
Create the configuration directory and generate the default config file:
[root@node2 local]# mkdir /etc/supervisor
[root@node2 ~]# echo_supervisord_conf >/etc/supervisor/supervisord.confKey sections of /etc/supervisor/supervisord.conf include:
[unix_http_server]
file=/tmp/supervisor.sock ; socket file path
[inet_http_server]
port=127.0.0.1:9001 ; TCP server (disabled by default)
username=root ; optional username
password=abc@123 ; optional password
[supervisord]
logfile=/tmp/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=false
minfds=1024
minprocs=200
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[include]
files = /etc/supervisor/supervisord.d/*.conf3. Create a custom program configuration (example: Jenkins)
[root@node2 ~]# more /etc/supervisor/supervisord.d/jenkins.conf
program:pro-jenkins]
command=java -jar /root/jenkins.war
priority=1
numprocs=1
autostart=true
autorestart=true
startretries=5
exitcodes=0
stopsignal=KILL
stopwaitsecs=10
redirect_stderr=true4. Start Supervisor
[root@node2 ~]# supervisord -c /etc/supervisor/supervisord.conf
[root@node2 ~]# ps -ef | grep supervisord5. Reload configuration
[root@node2 ~]# supervisorctl -c /etc/supervisor/supervisord.conf6. Check program status
[root@node2 ~]# supervisorctl -c /etc/supervisor/supervisord.conf
pro-jenkins STARTING
supervisor>
[root@node2 ~]# supervisorctl
pro-jenkins RUNNING pid 26538, uptime 0:00:02
supervisor>Finally, you can verify the web UI at the configured address to ensure the service is online.
If this article helped you, please like, share, and comment – it encourages further high‑quality content creation.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.