Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to restart only certain processes using supervisorctl?

Tags:

supervisord

People also ask

How do I restart Supervisorctl?

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 .

What does Supervisorctl reload do?

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.

How do you stop a supervisor process?

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.