如何使用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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Supervisord 支持进程组。您可以将进程分组为命名组并集中管理它们。
可以使用组名:
以及多个进程名来调用supervisorctl命令:
supervisord supports process groups. You can group processes into named groups and manage them collectively.
supervisorctl command can be called with a group name:
as well as with multiple process names:
由于supervisorctl在命令行上接受多个进程,因此您可以利用shell大括号扩展(例如在Bash中)来控制多个进程:
由shell扩展为
好像你已经明确地输入了该内容。
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:is expanded by the shell into
as if you had typed that out explicitly.