如何在supervisord中设置组? [英] How to setup a group in supervisord?

查看:162
本文介绍了如何在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

[程序: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,正常运行时间1天,21:56:23
tapjoy_game2 RUNNING pid 4698,正常运行时间1天,21:56:23
tapjoy_game3 RUNNING pid 4699,uptime 1天,21:56:23
tapjoy_game4 RUNNING pid 4700,正常运行时间1天,21:56:23
tapjoy_game5 RUNNING pid 4701,正常运行时间1天,21 :56:23


解决方案

c $ c> * 通配符以选择组中的所有程序:

  supervisorctl restart tapjoy: 

注意:shell可能需要你转义 code>,通常使用 \ *


So I'm setting up supervisord and trying to control several processes and that all works fine, now I want to setup a group so I can start/stop different sets of processes rather than all or nothing. Here's a snippet of my config file.

[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

Now from reading the docs this looks to me like it should work, but calling supervisorctl restart tapjoy: doesn't do anything.

Am I missing something?

Adding a star doesn't give an error, but doesn't do anything either.

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

解决方案

You need to use a * wildcard to select all programs in a group:

supervisorctl restart tapjoy:*

Note: it may that your shell requires you to escape the *, usually with \*

这篇关于如何在supervisord中设置组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆