From: Lennart Poettering Date: Thu, 22 Jun 2023 10:38:57 +0000 (+0200) Subject: pid1: use FORK_DEATHSIG where appropriate X-Git-Tag: v254-rc1~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54c0ba3409ebcf06e3d0ef7352cc613547d22a72;p=thirdparty%2Fsystemd.git pid1: use FORK_DEATHSIG where appropriate --- diff --git a/src/core/unit.c b/src/core/unit.c index f51b5687f8d..41b520563b7 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5335,15 +5335,13 @@ int unit_fork_helper_process(Unit *u, const char *name, pid_t *ret) { (void) unit_realize_cgroup(u); - r = safe_fork(name, FORK_REOPEN_LOG, ret); + r = safe_fork(name, FORK_REOPEN_LOG|FORK_DEATHSIG, ret); if (r != 0) return r; (void) default_signals(SIGNALS_CRASH_HANDLER, SIGNALS_IGNORE); (void) ignore_signals(SIGPIPE); - (void) prctl(PR_SET_PDEATHSIG, SIGTERM); - if (u->cgroup_path) { r = cg_attach_everywhere(u->manager->cgroup_supported, u->cgroup_path, 0, NULL, NULL); if (r < 0) {