Comment 78 for bug 350936

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 350936] Re: Should shut down domains on system shutdown

On Fri, 2011-03-18 at 17:13 +0000, Lars Hansson wrote:
> The problem with the upstart solution is that it doesn't work since
> Upstart will kill the virsh instances that you spawn in
> shutdown_guests.
> So far the only somewhat satisfactory solution is molly-guard.
>

Right, so you would need shutdown_guests to block until everything is in
fact shut down:

while box in `virsh list --all | grep '^ -'|grep -qv 'shut off'` ; do
  virsh shutdown all
  sleep 1
done

Note that currently libvirt-bin.conf has

stop on runlevel [!2345]

There is a bug in sendsigs that does not wait for these upstart jobs to
die before moving on to the end of the shutdown... so really, we also
need to fix that bug before the technique above will work.