start-stop-daemon: create pidfile before parent exits, closes 8596
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 14 Jan 2019 13:45:18 +0000 (14:45 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 14 Jan 2019 13:47:21 +0000 (14:47 +0100)
commit088fec36fedff2cd50437c95b7fb430abf8d303c
treef0dd190ed56fdf4b43710331e3527149903d87d2
parentb67d900395a847e29f2afa81198f783004c80fc5
start-stop-daemon: create pidfile before parent exits, closes 8596

This removes DAEMON_DOUBLE_FORK flag from bb_daemonize_or_rexec(),
as SSD was the only user.

Also includes fix for -S: now works without -a and -x,
does not print pids
(compat with "start-stop-daemon (OpenRC) 0.34.11 (Gentoo Linux)").

function                                             old     new   delta
start_stop_daemon_main                              1018    1084     +66
add_interface                                         99     103      +4
fail_hunk                                            139     136      -3
bb_daemonize_or_rexec                                205     183     -22
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 70/-25)             Total: 45 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
debianutils/start_stop_daemon.c
include/libbb.h
libbb/vfork_daemon_rexec.c
testsuite/start-stop-daemon.tests