如何在supervisord中设置组?

时间:2012-10-16 20:59:42

标签: python configuration supervisord

所以我正在设置supervisord并试图控制几个进程并且一切正常,现在我想设置一个组,这样我就可以启动/停止不同的进程集而不是全部或全部。这是我的配置文件的片段。

[group:tapjoy]
programs=tapjoy-game1,tapjoy-game2

[program:tapjoy-game1]
command=python tapjoy_pinger.py -g game1
directory=/go/here/first
redirect_stderr=true
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true

[program:tapjoy-game2]
command=python tapjoy_pinger.py -g game2
directory=/go/here/first
redirect_stderr=true
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true

现在,通过阅读文档,这对我来说就像它应该有效,但是呼唤 supervisorctl restart tapjoy: 什么都不做。

我错过了什么吗?

添加星标不会出错,但也不会做任何事情。

supervisorctl restart tapjoy:*
supervisorctl status
tapjoy_game1                     RUNNING    pid 4697, uptime 1 day, 21:56:23
tapjoy_game2                     RUNNING    pid 4698, uptime 1 day, 21:56:23
tapjoy_game3                     RUNNING    pid 4699, uptime 1 day, 21:56:23
tapjoy_game4                     RUNNING    pid 4700, uptime 1 day, 21:56:23
tapjoy_game5                     RUNNING    pid 4701, uptime 1 day, 21:56:23

2 个答案:

答案 0 :(得分:27)

您需要使用*通配符来选择组中的所有程序:

supervisorctl restart tapjoy:*

注意:您的shell可能要求您逃离*,通常使用\*

答案 1 :(得分:2)

我知道这是一个老线程,但我遇到了同样的问题,在这里找到答案会很好。所以为了将来的参考,而不是:

program=tapjoy-game1,tapjoy-game2

你需要:

programs=tapjoy-game1,tapjoy-game2

文档:http://supervisord.org/configuration.html#group-x-section-values