]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
daemon: Introduce parent_waits flag for daemonize().
authorAndre Noll <maan@systemlinux.org>
Sat, 12 Nov 2011 13:37:01 +0000 (14:37 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 13 Nov 2011 13:32:21 +0000 (14:32 +0100)
In daemon mode, para_server should not detach from the console
until it is listening on its command socket. The previous approach
turned out to be buggy and has been reverted in the previous commit.

This second attempt tries to get it right. It adds a boolean parameter
"parent_waits" to daemonize(). After daemonize() has forked, the
parent process does not exit immediately if parent_waits is true but
waits until the child process sends SIGTERM to its parent, or exits.

para_server makes use of the new flag in server_init(). The daemon
process (child) sends SIGTERM to its parent after the command socket
has been initialized. para_audiod, on the other hand, does not need
this feature, so it calls daemonize() with parent_waits == false to
get the old behaviour.


No differences found