]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Don't let parent of daemon exit until basic initialization is done
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 16 Oct 2009 11:14:54 +0000 (12:14 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 2 Nov 2009 16:41:35 +0000 (11:41 -0500)
commit4296cea2b20a84ab40beb4f95e6d8f9d6185d80b
tree62f88c2a3b3007bef97b2a59db13f1bd4065a15d
parenta71f79c37ef160b1605106bfe2d2f50b5e46a3ca
Don't let parent of daemon exit until basic initialization is done

The daemonizing code lets the parent exit almost immediately. This
means that it may think it has successfully started even when
important failures occur like not being able to acquire the PID
file. It also means network sockets are not yet open.

To address this when daemonizing the parent passes an open pipe
file descriptor to the child. The child does its basic initialization
and then writes a status code to the pipe indicating either success,
or failure. This ensures that when daemonizing, the parent does not
exit until the pidfile is acquired & basic network sockets are open.

Initialization of the libvirt drivers is still done asynchronously
since this may take a very long time.

* daemon/libvirtd.c: Force parent to stay around until basic config
  file, pidfile & network socket init is completed
daemon/libvirtd.c