Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restarting nicely with supervisord

See original GitHub issue

Issue Description

I 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 run_huey --periodic
root     13367  1166  0 03:55 ?        00:00:00 /bin/sh /srv/django/tatianastore/ run_huey --periodic
root     13370 13367  6 03:55 ?        00:00:00 python 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 run_huey --periodic
root     13370     1  2 03:55 ?        00:00:00 python run_huey --periodic
root     13401  1166  0 03:55 ?        00:00:00 /bin/sh /srv/django/tatianastore/ run_huey --periodic
root     13404 13401 14 03:55 ?        00:00:00 python run_huey --periodic
root     13433 10409  0 03:55 pts/1    00:00:00 grep --color=auto -i huey

My supervisor config:

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:closed
  • Created 8 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

coleifercommented, Feb 12, 2015

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:

command=/srv/django/tatianastore/bin/python /srv/django/tatianastore/ run_huey --periodic
coleifercommented, Jul 7, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found