Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quit child processes when supervisor crashes (Linux only) #649

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Add constant outside of class, remove unused import
lukeweber committed Aug 18, 2015
commit c9a39d08e837224b762653fb1780762ed898b198
5 changes: 3 additions & 2 deletions supervisor/process.py
Original file line number Diff line number Diff line change
@@ -26,10 +26,12 @@
from supervisor import events

from supervisor.datatypes import RestartUnconditionally
from supervisor.datatypes import signal_number

from supervisor.socket_manager import SocketManager

# Constant from http://linux.die.net/include/linux/prctl.h
PR_SET_PDEATHSIG = 1

@total_ordering
class Subprocess(object):

@@ -303,7 +305,6 @@ def _spawn_as_child(self, filename, argv):
import ctypes
import ctypes.util
libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
PR_SET_PDEATHSIG = 1
libc.prctl(PR_SET_PDEATHSIG, signal.SIGKILL)
except Exception:
options.logger.debug("Could not set parent death signal.")