On Linux running supervisor 3.0b1, sending a SIGKILL to the supervisord process does not terminate all its child processes i.e. the processes started through the configuration file.
SIGKILL can't be trapped. This demonstrates it:
$ python
>>> import signal
>>> def handler(signum, frame):
... pass
...
>>> signal.signal(signal.SIGKILL, handler)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: (22, 'Invalid argument')
>>>
There's nothing we can add or change in our code to change that.
Certainly, but why killing the parent process doesn't kill the child ones? I mean at the Linux level, not through supervisord intercepting SIGKILL and killing its children.
FWIW, if supervisor is pid 19285:
kill -9 -19285
Negating the pid sends the kill signal to the whole process group.
I was trying to achieve the same thing. Sending SIGTERM instead of SIGKILL worked for me.
I would prefer the "SIGTERM" over "SIGKILL with negated process ID" since it allows graceful shutdown.
Most helpful comment
FWIW, if supervisor is pid 19285:
Negating the pid sends the kill signal to the whole process group.