[PATCH] bb_daemonize: double-fork to ensure child doesn't get controlling tty
Peter Korsgaard
jacmet at sunsite.dk
Wed Nov 9 15:36:42 UTC 2011
>>>>> "Denys" == Denys Vlasenko <vda.linux at googlemail.com> writes:
Hi,
Denys> Fork is expensive. vfork+exec on NOMMU doubly so.
Denys> In many cases, callers know that they will never try open a tty.
Denys> Let's make this second fork_or_rexec() optional:
Denys> if (flags & DAEMON_DOUBLE_FORK) ...
Ok. From a quick look it only seems to only be needed for
start-stop-daemon as the other users either don't exec or do another
fork before executing programs.
I'll send an updated patch shortly.
--
Bye, Peter Korsgaard
More information about the busybox
mailing list