Comment 38 for bug 350936

Revision history for this message
Andy (andy-xillean) wrote :

Ok so I came up with a workaround that seems to be working for me. The guests shutdown completely. Not sure what this breaks if anything. There still needs to be a permanent fix for this bug but here is what I did.

(1)
Edit /etc/init/libvirt-bin.conf
I added this under the "pre-start script" section.

pre-stop script
        /etc/init.d/kvmguests stop
end script

(2)
Edit /etc/init.d/sendsigs

Search in /etc/init.d/sendsigs for "do_stop () {" and add these lines right below it.

kvm_shutdown_timeout=30
while /bin/ls /var/run/libvirt/qemu/*.pid>/dev/null 2>&1 && [ $kvm_shutdown_timeout -gt 0 ]
        do
        sleep 1
        kvm_shutdown_timeout=$(expr $kvm_shutdown_timeout - 1)
done

(3)
Create sys-v init script kvmguests and put it in /etc/init.d and make it executable.
Here is mine attached to this post. It can also be used to manually stop the guests.

**Notes: The kvm_shutdown_timeout=30 in /etc/init.d/sendsigs can be tuned to your environment.