The python script supervisord is a powerful tool used by a lot of guys to manage the processes. I like supervisord too.
But this tool requires that the big python environment be installed in target system. In some situation, for example in the docker environment, the python is too big for us.
This project re-implements supervisord in go-lang. Compiled supervisord is very suitable for environments where python is not installed.
Before compiling the supervisord, make sure the go-lang 1.11+ is installed in your environment.
To compile supervisord for linux, run following commands:
To compile supervisord for windows, run following commands on one Windows PC:
After a supervisord binary has been generated, create a supervisord configuration file and start the supervisord like this:
$ cat supervisor.conf
[program:test]
command = /your/program args
$ supervisord -c supervisor.conf
supervisord runs in the foreground unless -d is given. For compatibility with Python supervisord it also accepts -n/--nodaemon (run in the foreground; overrides -d) and -e/--loglevel <level> (overrides loglevel in the configuration file).
Please note that config-file location autodetected in this order:
Add the inet interface in your configuration:
[inet_http_server]
port=127.0.0.1:9001
then run
$ supervisord -c supervisor.conf -d
In order to manage the daemon, you can use supervisord ctl subcommand, available subcommands are: status, start, stop, shutdown, reload.
$ supervisord ctl add group-1 program-1
$ supervisord ctl remove group-1 program-1
$ supervisord ctl update
$ supervisord ctl update group-1
$ supervisord ctl update all
$ supervisord ctl clear program-1 program-2
$ supervisord ctl clear all
$ supervisord ctl reread
$ supervisord ctl status
$ supervisord ctl status program-1 program-2...
$ supervisord ctl status group:*
$ supervisord ctl stop program-1 program-2...
$ supervisord ctl stop group:*
$ supervisord ctl stop all
$ supervisord ctl start program-1 program-2...
$ supervisord ctl start group:*
$ supervisord ctl start all
$ supervisord ctl restart program-1 program-2...
$ supervisord ctl restart group:*
$ supervisord ctl restart all
$ supervisord ctl shutdown
$ supervisord ctl reload
$ supervisord ctl signal <signal_name> <process_name> <process_name> ...
$ supervisord ctl signal <signal_name> all
$ supervisord ctl pid
$ supervisord ctl pid <process_name>
$ supervisord ctl pid all
$ supervisord ctl fg <process_name>
$ supervisord ctl tail <process_name> [stdout|stderr]
$ supervisord ctl tail -f <process_name> [stdout|stderr]
Please note that supervisor ctl subcommand works correctly only if http server is enabled in [inet_http_server], and serverurl correctly set. Unix domain socket is not currently supported for this pupose.
Serverurl parameter detected in the following order:
Command "version" will show the current supervisord binary version.
$ supervisord version
Http server can work via both unix domain socket and TCP. Basic auth is optional and supported too.
The unix domain socket setting is in the "unix_http_server" section. The TCP http server setting is in "inet_http_server" section.
If both "inet_http_server" and "unix_http_server" are not set up in the configuration file, no http server will be started.
Following parameters configured in "supervisord" section:
Supervised program settings configured in [program:programName] section and include these options:
string://, file://, or command:// methods to set the standard input value.envFiles.[program:A]
depends_on = B, C
[program:B]
...
[program:C]
...
All common parameters that are identical for all supervised programs can be defined once in "program-default" section and omitted in all other program sections.
In example below the VAR1 and VAR2 environment variables apply to both test1 and test2 supervised programs:
[program-default]
environment=VAR1="value1",VAR2="value2"
envFiles=global.env,prod.env
[program:test1]
...
[program:test2]
...
Section "group" is supported and you can set "programs" item
Supervisord 3.x defined events are supported partially. Now it supports following events:
Supervisord can redirect stdout and stderr ( fields stdout_logfile, stderr_logfile ) of supervised programs to:
Multiple log files can be configured for the stdout_logfile and stderr_logfile with ',' as delimiter. For example:
stdout_logfile = test.log, /dev/stdout
if write the log to the syslog, following additional parameter can be set like:
syslog_facility=local0
syslog_tag=test
syslog_stdout_priority=info
syslog_stderr_priority=err
Supervisord has builtin web GUI: you can start, stop & check the status of program from the GUI for one/multi supervisord instances. Following picture shows a GUI with two nodes:

Please note that in order to see|use Web GUI you should configure it in /etc/supervisord.conf both in [inet_http_server] (and|or [unix_http_server] if you prefer unix domain socket) and [supervisorctl]:
If you like to check status of another supervisord instances, you need to configure additional parameters in section inet_http_server:
[inet_http_server]
nodename=node-1
port=127.0.0.1:9001
username=test1
password=thepassword
remote_1_node=node-2
remote_1_port=10.0.0.2:9001
remote_1_user=test1
remote_1_passwrod=test1
remote_2_node=node-3
remote_2_port=10.0.0.3:9001
remote_2_user=test2
remote_2_passwrod=test2
[supervisorctl]
serverurl=http://127.0.0.1:9001
supervisord is compiled inside a Docker image to be used directly inside another image, from the Docker Hub version.
FROM debian:latest
COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord
CMD ["/usr/local/bin/supervisord"]
The supervisord can be integrated with the linux systemctl. The following supervisord.service is an example for the systemctl integration:
[Unit]
Description=Go Supervisord Process Manager
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/supervisord -c /etc/supervisord.conf
ExecStop=/usr/local/bin/supervisord shutdown
ExecReload=/usr/local/bin/supervisord reload
Restart=on-failure
RestartSec=5s
# Security and Limit Configurations
LimitNOFILE=65536
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Put to supervisord binary to /usr/local/bin and the configuration file to /etc/supervisord.conf. And put the above supervisord.service to systemctl required directory, for example, the supervisord.service will be put to directory /usr/lib/systemd/system for the ubuntu linux family.
Then the supervisord can be managed by systemctl and we can start/stop/restart it like:
systemctl daemon-reload
systemctl start supervisord
systemctl restart supervisord
systemctl stop supervisord
The Prometheus node exporter supported supervisord metrics are now integrated into the supervisor. So there is no need to deploy an extra node_exporter to collect the supervisord metrics. To collect the metrics, the port parameter in section "inet_http_server" must be configured and the metrics server is started on the path /metrics of the supervisor http server.
For example, if the port parameter in "inet_http_server" is "127.0.0.1:9001" and then the metrics server should be accessed in url "http://127.0.0.1:9001/metrics"
Autostart supervisord after os started. Look up supported platforms at kardianos/service.
# install
sudo supervisord service install -c full_path_to_conf_file
# uninstall
sudo supervisord service uninstall
# start
supervisord service start
# stop
supervisord service stop
Overall
Maintained
Code review
Go module
Latest release
Releases this year
(top 24 of 27)
1,790 followers · starred Oct 2020
779 followers · starred Jun 2018
252 followers · starred Jan 2022
493 followers · starred Sep 2026
The python script supervisord is a powerful tool used by a lot of guys to manage the processes. I like supervisord too.
But this tool requires that the big python environment be installed in target system. In some situation, for example in the docker environment, the python is too big for us.
This project re-implements supervisord in go-lang. Compiled supervisord is very suitable for environments where python is not installed.
Before compiling the supervisord, make sure the go-lang 1.11+ is installed in your environment.
To compile supervisord for linux, run following commands:
To compile supervisord for windows, run following commands on one Windows PC:
After a supervisord binary has been generated, create a supervisord configuration file and start the supervisord like this:
$ cat supervisor.conf
[program:test]
command = /your/program args
$ supervisord -c supervisor.conf
supervisord runs in the foreground unless -d is given. For compatibility with Python supervisord it also accepts -n/--nodaemon (run in the foreground; overrides -d) and -e/--loglevel <level> (overrides loglevel in the configuration file).
Please note that config-file location autodetected in this order:
Add the inet interface in your configuration:
[inet_http_server]
port=127.0.0.1:9001
then run
$ supervisord -c supervisor.conf -d
In order to manage the daemon, you can use supervisord ctl subcommand, available subcommands are: status, start, stop, shutdown, reload.
$ supervisord ctl add group-1 program-1
$ supervisord ctl remove group-1 program-1
$ supervisord ctl update
$ supervisord ctl update group-1
$ supervisord ctl update all
$ supervisord ctl clear program-1 program-2
$ supervisord ctl clear all
$ supervisord ctl reread
$ supervisord ctl status
$ supervisord ctl status program-1 program-2...
$ supervisord ctl status group:*
$ supervisord ctl stop program-1 program-2...
$ supervisord ctl stop group:*
$ supervisord ctl stop all
$ supervisord ctl start program-1 program-2...
$ supervisord ctl start group:*
$ supervisord ctl start all
$ supervisord ctl restart program-1 program-2...
$ supervisord ctl restart group:*
$ supervisord ctl restart all
$ supervisord ctl shutdown
$ supervisord ctl reload
$ supervisord ctl signal <signal_name> <process_name> <process_name> ...
$ supervisord ctl signal <signal_name> all
$ supervisord ctl pid
$ supervisord ctl pid <process_name>
$ supervisord ctl pid all
$ supervisord ctl fg <process_name>
$ supervisord ctl tail <process_name> [stdout|stderr]
$ supervisord ctl tail -f <process_name> [stdout|stderr]
Please note that supervisor ctl subcommand works correctly only if http server is enabled in [inet_http_server], and serverurl correctly set. Unix domain socket is not currently supported for this pupose.
Serverurl parameter detected in the following order:
Command "version" will show the current supervisord binary version.
$ supervisord version
Http server can work via both unix domain socket and TCP. Basic auth is optional and supported too.
The unix domain socket setting is in the "unix_http_server" section. The TCP http server setting is in "inet_http_server" section.
If both "inet_http_server" and "unix_http_server" are not set up in the configuration file, no http server will be started.
Following parameters configured in "supervisord" section:
Supervised program settings configured in [program:programName] section and include these options:
string://, file://, or command:// methods to set the standard input value.envFiles.[program:A]
depends_on = B, C
[program:B]
...
[program:C]
...
All common parameters that are identical for all supervised programs can be defined once in "program-default" section and omitted in all other program sections.
In example below the VAR1 and VAR2 environment variables apply to both test1 and test2 supervised programs:
[program-default]
environment=VAR1="value1",VAR2="value2"
envFiles=global.env,prod.env
[program:test1]
...
[program:test2]
...
Section "group" is supported and you can set "programs" item
Supervisord 3.x defined events are supported partially. Now it supports following events:
Supervisord can redirect stdout and stderr ( fields stdout_logfile, stderr_logfile ) of supervised programs to:
Multiple log files can be configured for the stdout_logfile and stderr_logfile with ',' as delimiter. For example:
stdout_logfile = test.log, /dev/stdout
if write the log to the syslog, following additional parameter can be set like:
syslog_facility=local0
syslog_tag=test
syslog_stdout_priority=info
syslog_stderr_priority=err
Supervisord has builtin web GUI: you can start, stop & check the status of program from the GUI for one/multi supervisord instances. Following picture shows a GUI with two nodes:

Please note that in order to see|use Web GUI you should configure it in /etc/supervisord.conf both in [inet_http_server] (and|or [unix_http_server] if you prefer unix domain socket) and [supervisorctl]:
If you like to check status of another supervisord instances, you need to configure additional parameters in section inet_http_server:
[inet_http_server]
nodename=node-1
port=127.0.0.1:9001
username=test1
password=thepassword
remote_1_node=node-2
remote_1_port=10.0.0.2:9001
remote_1_user=test1
remote_1_passwrod=test1
remote_2_node=node-3
remote_2_port=10.0.0.3:9001
remote_2_user=test2
remote_2_passwrod=test2
[supervisorctl]
serverurl=http://127.0.0.1:9001
supervisord is compiled inside a Docker image to be used directly inside another image, from the Docker Hub version.
FROM debian:latest
COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/local/bin/supervisord
CMD ["/usr/local/bin/supervisord"]
The supervisord can be integrated with the linux systemctl. The following supervisord.service is an example for the systemctl integration:
[Unit]
Description=Go Supervisord Process Manager
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/local/bin/supervisord -c /etc/supervisord.conf
ExecStop=/usr/local/bin/supervisord shutdown
ExecReload=/usr/local/bin/supervisord reload
Restart=on-failure
RestartSec=5s
# Security and Limit Configurations
LimitNOFILE=65536
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Put to supervisord binary to /usr/local/bin and the configuration file to /etc/supervisord.conf. And put the above supervisord.service to systemctl required directory, for example, the supervisord.service will be put to directory /usr/lib/systemd/system for the ubuntu linux family.
Then the supervisord can be managed by systemctl and we can start/stop/restart it like:
systemctl daemon-reload
systemctl start supervisord
systemctl restart supervisord
systemctl stop supervisord
The Prometheus node exporter supported supervisord metrics are now integrated into the supervisor. So there is no need to deploy an extra node_exporter to collect the supervisord metrics. To collect the metrics, the port parameter in section "inet_http_server" must be configured and the metrics server is started on the path /metrics of the supervisor http server.
For example, if the port parameter in "inet_http_server" is "127.0.0.1:9001" and then the metrics server should be accessed in url "http://127.0.0.1:9001/metrics"
Autostart supervisord after os started. Look up supported platforms at kardianos/service.
# install
sudo supervisord service install -c full_path_to_conf_file
# uninstall
sudo supervisord service uninstall
# start
supervisord service start
# stop
supervisord service stop
Overall
Maintained
Code review
Go module
Latest release
Releases this year
(top 24 of 27)
1,790 followers · starred Oct 2020
779 followers · starred Jun 2018
252 followers · starred Jan 2022
493 followers · starred Sep 2026