]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: use FORK_DEATHSIG where appropriate
authorLennart Poettering <lennart@poettering.net>
Thu, 22 Jun 2023 10:38:57 +0000 (12:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 22 Jun 2023 14:05:37 +0000 (16:05 +0200)
src/core/unit.c

index f51b5687f8d5a7b30179fecf91ee114340ee361c..41b520563b7fcf14a2f79b20282f1688bc3fa4de 100644 (file)
@@ -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) {