Restarting nicely with supervisord
See original GitHub issueI am trying to make supervisorctl restart
to work with huey. At the moment, restart doesn’t kill the old process, but still creates another running huey instance.
Below is a terminal capture showing huey is duplicated on restart:
(venv)root@Ubuntu-1204-precise-64-minimal /srv/django/tatianastore # ps -Af|grep -i huey
root 11260 1 0 03:46 ? 00:00:01 python manage.py run_huey --periodic
root 13367 1166 0 03:55 ? 00:00:00 /bin/sh /srv/django/tatianastore/manage_wrapper.sh run_huey --periodic
root 13370 13367 6 03:55 ? 00:00:00 python manage.py run_huey --periodic
root 13378 10409 0 03:55 pts/1 00:00:00 grep --color=auto -i huey
(venv)root@Ubuntu-1204-precise-64-minimal /srv/django/tatianastore # supervisorctl restart tatianastore_huey
tatianastore_huey: stopped
tatianastore_huey: started
(venv)root@Ubuntu-1204-precise-64-minimal /srv/django/tatianastore # ps -Af|grep -i hueyroot 11260 1 0 03:46 ? 00:00:01 python manage.py run_huey --periodic
root 13370 1 2 03:55 ? 00:00:00 python manage.py run_huey --periodic
root 13401 1166 0 03:55 ? 00:00:00 /bin/sh /srv/django/tatianastore/manage_wrapper.sh run_huey --periodic
root 13404 13401 14 03:55 ? 00:00:00 python manage.py run_huey --periodic
root 13433 10409 0 03:55 pts/1 00:00:00 grep --color=auto -i huey
My supervisor config: https://github.com/miohtama/LibertyMusicStore/blob/master/conf/supervisor.conf
Which UNIX signal supervisor needs to send to huey in order to properly stop it? Or are there any special considerations regarding daemonizing huey process?
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Supervisord: Restarting and Reloading - Onur Güzel
Supervisord is a great daemon for managing application processes. However it does not have a reload option, and restart works different than we ......
Read more >how to restart only certain processes using supervisorctl?
So to directly answer the OP's question, you can't directly restart a specific process. You can only restart groups, which requires a group...
Read more >Running Supervisor — Supervisor 4.2.4 documentation
To change the set of programs controlled by supervisord, edit the supervisord.conf file and kill -HUP or otherwise restart the supervisord process.
Read more >Using Supervisord, how can I start a brand new worker via ...
Running supervisorctl update will unfortunately restart all workers. Here's a sample of the output: workers: stopped followed by workers: ...
Read more >Process Monitoring with Supervisord | Servers for Hackers
They watch processes and restart them if they fail, and ensure they start on ... There's other things we can do with supervisorctl...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright I was able to replicate this locally and the issue is the fact that you’re using a bash script to run the consumer. When I used a bash script to invoke the consumer, the consumer would continue running indefinitely. When I replaced the bash script with a direct invocation of the consumer, it worked as expected.
So, here is how I would suggest changing your config – I believe this will accomplish the same thing as your wrapper:
The info in this comment is a bit outdated: when huey consumer receives SIGTERM, it will not wait for any currently-executing tasks to finish.