How to setup a group in supervisord?
Question:
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
Answers:
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 *
I know it’s an old thread, but I ran into the same problem, and it would’ve been good to find the answer here. So for future reference, instead of:
program=tapjoy-game1,tapjoy-game2
You need:
programs=tapjoy-game1,tapjoy-game2
Docs: http://supervisord.org/configuration.html#group-x-section-values
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 *
I know it’s an old thread, but I ran into the same problem, and it would’ve been good to find the answer here. So for future reference, instead of:
program=tapjoy-game1,tapjoy-game2
You need:
programs=tapjoy-game1,tapjoy-game2
Docs: http://supervisord.org/configuration.html#group-x-section-values