[Libvir] [PATCH] Synchronous daemon restart

Mark McLoughlin markmc at redhat.com
Wed May 2 16:50:41 UTC 2007


Hey,
	See:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=238492

	Basically, doing a "service libvirtd restart", you see:

  libvirt-qemud: Failed to autostart network 'default': cannot create bridge 'virbr0' : File exists

	and the default network is broken.

	The problem turns out to be that the initscript doesn't wait before the
old daemon has shut down before starting the new one.

	The fix is simple - if you don't pass a kill level argument to
killproc(), then it will block for a few seconds until the daemon has
shutdown before killing it with a SIGKILL.

Cheers,
Mark.

Index: qemud/libvirtd.in
===================================================================
RCS file: /data/cvs/libvirt/qemud/libvirtd.in,v
retrieving revision 1.1
diff -u -p -r1.1 libvirtd.in
--- qemud/libvirtd.in	23 Feb 2007 12:50:58 -0000	1.1
+++ qemud/libvirtd.in	2 May 2007 16:47:18 -0000
@@ -34,7 +34,7 @@ start() {
 stop() {
     echo -n $"Stopping $SERVICE daemon: "
 
-    killproc $PROCESS -TERM
+    killproc $PROCESS
     RETVAL=$?
     echo
     if [ $RETVAL -eq 0 ]; then





More information about the libvir-list mailing list