aboutsummaryrefslogtreecommitdiff
path: root/debianutils/start_stop_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils/start_stop_daemon.c')
-rw-r--r--debianutils/start_stop_daemon.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 9d60b2c7f..07c104baa 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -516,6 +516,11 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
516 /* DAEMON_DEVNULL_STDIO is superfluous - 516 /* DAEMON_DEVNULL_STDIO is superfluous -
517 * it's always done by bb_daemonize() */ 517 * it's always done by bb_daemonize() */
518#else 518#else
519 /* Daemons usually call bb_daemonize_or_rexec(), but SSD can do
520 * without: SSD is not itself a daemon, it _execs_ a daemon.
521 * The usual NOMMU problem of "child can't run indefinitely,
522 * it must exec" does not bite us: we exec anyway.
523 */
519 pid_t pid = xvfork(); 524 pid_t pid = xvfork();
520 if (pid != 0) { 525 if (pid != 0) {
521 /* parent */ 526 /* parent */
@@ -525,12 +530,8 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
525 } 530 }
526 /* Child */ 531 /* Child */
527 setsid(); /* detach from controlling tty */ 532 setsid(); /* detach from controlling tty */
528 /* Redirect stdio to /dev/null, close extra FDs. 533 /* Redirect stdio to /dev/null, close extra FDs */
529 * We do not actually daemonize because of DAEMON_ONLY_SANITIZE */ 534 bb_daemon_helper(DAEMON_DEVNULL_STDIO + DAEMON_CLOSE_EXTRA_FDS);
530 bb_daemonize_or_rexec(DAEMON_DEVNULL_STDIO
531 + DAEMON_CLOSE_EXTRA_FDS
532 + DAEMON_ONLY_SANITIZE,
533 NULL /* argv, unused */ );
534#endif 535#endif
535 } 536 }
536 if (opt & OPT_MAKEPID) { 537 if (opt & OPT_MAKEPID) {