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.


** Attachment added: "init script to shutdown guests on host shutdown."
   
https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/350936/+attachment/1492852/+files/kvmguests

-- 
Should shut down domains on system shutdown
https://bugs.launchpad.net/bugs/350936
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to