From 6b2b909d33fe2168f9d314df223be3adfc248f24 Mon Sep 17 00:00:00 2001 From: Unbit Date: Thu, 3 Oct 2013 19:46:33 +0200 Subject: [PATCH] apply PR_SET_PDEATHSIG to vassals on linux --- core/emperor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/emperor.c b/core/emperor.c index 04922282..53c2b478 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -959,6 +959,12 @@ int uwsgi_emperor_vassal_start(struct uwsgi_instance *n_ui) { static void uwsgi_emperor_spawn_vassal(struct uwsgi_instance *n_ui) { +#ifdef __linux__ + if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0)) { + uwsgi_error("prctl()"); + } +#endif + if (uwsgi.emperor_tyrant) { uwsgi_log("[emperor-tyrant] dropping privileges to %d %d for instance %s\n", (int) n_ui->uid, (int) n_ui->gid, n_ui->name); if (setgid(n_ui->gid)) {