How to restart only certain processes using supervisorctl

supervisord

I'm running a few processes using supervisord, named process1, process2, …, process8. If I want to restart process{1-4}, how can I do that with supervisorctl?

Best Answer

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
Related Topic