To start a non-running service or stop a running one, use supervisorctl start my-daemon and supervisorctl stop my-daemon . To restart a service, you can also use supervisorctl restart my-daemon .
These command makes the following effects. Restart supervisor service without making configuration changes available. It stops, and re-starts all managed applications. Restart application without making configuration changes available.
Finally, you can exit supervisorctl with Ctrl+C or by entering quit into the prompt: supervisor> quit.
supervisord supports process groups. You can group processes into named groups and manage them collectively.
[unix_http_server]
file=%(here)s/supervisor.sock
[supervisord]
logfile=supervisord.log
pidfile=supervisord.pid
[program:cat1]
command=cat
[program:cat2]
command=cat
[program:cat3]
command=cat
[group:foo]
programs=cat1,cat3
[supervisorctl]
serverurl=unix://%(here)s/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
supervisorctl command can be called with a group name:
supervisorctl restart foo:
as well as with multiple process names:
supervisorctl restart foo:cat1 cat2
Since supervisorctl
accepts multiple processes on the command line, you can take advantage of shell brace expansion (e.g. in Bash) to control multiple processes:
supervisorctl restart process{1..4}
is expanded by the shell into
supervisorctl restart process1 process2 process3 process4
as if you had typed that out explicitly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With