bb_daemonize_or_rexec(): add flag to double-fork; use it in start-stop-daemon
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 9 Nov 2011 18:44:37 +0000 (19:44 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 9 Nov 2011 18:44:37 +0000 (19:44 +0100)
commit743edac6c84ac207d0bb4c3124b0e8fe450a38b4
treed74290b238665a3369e191dd85e7a4b38f74aadb
parent7e21f0491cf3e72835cd9b515734caec56d41e70
bb_daemonize_or_rexec(): add flag to double-fork; use it in start-stop-daemon

Add a DAEMON_DOUBLE_FORK flag to make bb_daemonize double-fork so it isn't a
session leader, and hence doesn't get a controlling tty on Linux if a tty is
ever opened, similar to how libdaemon's daemon_fork or the big
start-stop-daemon does it - And use it in start-stop-daemon.

For details, see http://www.win.tue.nl/~aeb/linux/lk/lk-10.html#ss10.3

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
debianutils/start_stop_daemon.c
include/libbb.h
libbb/vfork_daemon_rexec.c