when resorting to SIGKILL send signal (optionally) to whole process group #30

Merged
merged 2 commits into from Aug 18, 2011

Projects

None yet

3 participants

@pedronis
Contributor

add a boolean program option killasgroup with tests, defaulting to
false, if true when resorting to send SIGKILL to stop/terminate the
process send it to its whole process group instead to take care of
children as well and not leave them behind. comes with docs changes as well.

see mailing list thread starting with: http://lists.supervisord.org/pipermail/supervisor-users/2011-August/000946.html

pedronis added some commits Aug 12, 2011
@pedronis pedronis add a boolean program option killasgroup with tests, defaulting to
false, if true when resorting to send SIGKILL to stop/terminate the
process send it to its whole process group instead to take care of
children as well and not leave them behind.
f0c3cd4
@pedronis pedronis update docs and changes for killasgroup ba7391e
@mnaberez mnaberez merged commit 1d7e0a2 into Supervisor:master Aug 18, 2011
Member

Is there a reason not to send SIGTERM to the whole group as well?

Owner
mnaberez commented Feb 1, 2012

Not that I can see... this is something we should consider.

Contributor
pedronis commented Feb 6, 2012

On Wed, 2012-02-01 at 11:13 -0800, Roger Hoover wrote:

Is there a reason not to send SIGTERM to the whole group as well?

usually one has a parent process and children, when the parent gets
SIGTERM it will/should have a coordinated way and should be the one in
charge of sending signals or by other means shutting down the children.
When it takes too much time or is still hanging in itself and one has to
resort to SIGKILL then it makes sense to send it to the group. Basically
there are at least cases were sending SIGTERM to the group would be
harmful...


Reply to this email directly or view it on GitHub:
#30 (comment)

Member

I think this should be another option, then, called stopasgroup so that you can turn it on if you need it. I've run into a case where I want to run Flask in debug mode under supervisord in development and the parent Flask process doesn't propagate the signal to it's child, leaving it orphaned. This doesn't happen on the command line b/c the shell sends SIGINT to the entire foreground process group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment