daemonize icon indicating copy to clipboard operation
daemonize copied to clipboard

Wait for the first child to fork before exiting

Open bartelsielski opened this issue 3 years ago • 0 comments

Without the waitpid() it is possible that the setsid() has not completed yet when the main process terminates, potentially causing a race condition:

If setsid() has not completed and the controlling terminal is closed, the session leader will be sent a SIGHUP signal. By default this terminates the process and then all processes in the session group will also receive a SIGHUP.

bartelsielski avatar Jul 18 '22 11:07 bartelsielski