From aaaef51f2a06a68d16a89298b8fa07b867fc8330 Mon Sep 17 00:00:00 2001 From: "roberto@quantal64" Date: Wed, 13 Jun 2012 11:04:35 +0200 Subject: [PATCH] be sure brained/patched mules are killed when the master dies --- mule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mule.c b/mule.c index 5fb3efc1..54b9355d 100644 --- a/mule.c +++ b/mule.c @@ -36,6 +36,11 @@ void uwsgi_mule(int id) { pid_t pid = uwsgi_fork(uwsgi.mules[id-1].name); if (pid == 0) { +#ifdef __linux__ + if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0,0,0)) { + uwsgi_error("prctl()"); + } +#endif uwsgi.muleid = id; // avoid race conditions uwsgi.mules[id-1].id = id;