]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-event: set FORK_DEATHSIG flag
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 22 Oct 2018 09:27:57 +0000 (18:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 23 Oct 2018 19:46:48 +0000 (04:46 +0900)
src/udev/udev-event.c

index ee56c283482978ef0d6ea75507aef9780c4a9189..0c4b4c9ba4985b241ac9b24eec4629345ec66570 100644 (file)
@@ -449,9 +449,6 @@ static int spawn_exec(struct udev_event *event,
                 fd_stderr = safe_close(fd_stderr);
         }
 
-        /* terminate child in case parent goes away */
-        prctl(PR_SET_PDEATHSIG, SIGTERM);
-
         execve(argv[0], argv, envp);
 
         /* exec failed */
@@ -736,7 +733,7 @@ int udev_event_spawn(struct udev_event *event,
 
         log_debug("Starting '%s'", cmd);
 
-        r = safe_fork("(spawn)", FORK_RESET_SIGNALS|FORK_LOG, &pid);
+        r = safe_fork("(spawn)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &pid);
         if (r < 0)
                 return log_error_errno(r, "Failed to fork() to execute command '%s': %m", cmd);
         if (r == 0) {