题
我正在使用Substisord运行几个进程,命名Process1,Process2,...,Process8。如果我想重新启动进程{1-4},我该如何使用sustistisorctl?
解决方案
主管支持 过程组. 。您可以将流程分为命名组并集体管理。
[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命令:
supervisorctl restart foo:
以及多个过程名称:
supervisorctl restart foo:cat1 cat2
其他提示
自从 supervisorctl
接受命令行上的多个进程,您可以利用Shell Brace扩展(例如Bash)控制多个过程:
supervisorctl restart process{1..4}
扩展 由外壳 进入
supervisorctl restart process1 process2 process3 process4
好像您已经明确输入了该内容。
不隶属于 StackOverflow