如何使用 supervisorctl 仅重启某些进程? [英] how to restart only certain processes using supervisorctl?
本文介绍了如何使用 supervisorctl 仅重启某些进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 supervisord 运行一些进程,名为 process1、process2、...、process8.如果我想重新启动进程{1-4},我该如何使用 supervisorctl 来实现?
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?
推荐答案
supervisord 支持 进程组.您可以将进程分组到命名组中并对其进行集中管理.
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命令:
supervisorctl command can be called with a group name:
supervisorctl restart foo:
以及多个进程名称:
supervisorctl restart foo:cat1 cat2
这篇关于如何使用 supervisorctl 仅重启某些进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文