Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using supervisor 3 to daemonize a python process, which is launched through a bash script that sets up some configuration for python. The bash script runs python program in the foreground, FWIW.

This setup has the following problem: when supervisord tries to kill the process, it only kills the bash script, not the python process. So I end up leaking python processes running old code and all sorts of problems ensue. How can I fix this?

Is there some configuration option for supervisor to tell it to kill child processes as well?

Would it help to have the bash script trap the TERM signal and explicitly pass it on to the child? This seems unnecessary since when I run it from an interactive shell, the child python process is killed just fine.

I see that supervisor lets me pick which signal to kill with, defaulting to TERM right now. Might changing that help?

share|improve this question

1 Answer 1

Here's a similar question on Stackoverflow:

Tornado doesn't restart cleanly in supervisor

Solution that worked for me was to use stopasgroup = true in the relevant [program:x] group.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.