Supervisor: Sending SIGKILL to supervisord does not terminate children

Created on 21 Nov 2012  ·  5Comments  ·  Source: Supervisor/supervisor

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.

Most helpful comment

FWIW, if supervisor is pid 19285:

  kill -9 -19285

Negating the pid sends the kill signal to the whole process group.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Siecje picture Siecje  ·  5Comments

meshy picture meshy  ·  4Comments

mnaberez picture mnaberez  ·  4Comments

detailyang picture detailyang  ·  4Comments

abevoelker picture abevoelker  ·  3Comments