[libvirt-users] systemctl libvirt-guests.service fails to start during host boot

Andrea Bolognani abologna at redhat.com
Tue Sep 6 12:56:29 UTC 2016


On Thu, 2016-08-11 at 20:41 +0200, Benoit wrote:
> Thanks Andrea,
> 
> Yes I confirm to you that I have enabled libvirt as well.
> 
> I don't see any error right now but I have to investigate a little bit more.
> 
> My guests are in autostart in virsh so everything is fine on this, the 
> only issue I got is in case of shutdown.
> 
> The strange thing is that sometimes libvirt-guests is up and running 
> sometimes failed...

I'm trying to track this down, but 1) I can't reproduce it
on my setup and 2) it doesn't make any sense :)

It's almost as if libvirtd.service would be started during
boot, but not every single time. Except you always have it
running after boot, right?

And After=libvirtd.service tells systemd *exactly* to wait
until libvirtd has started before starting libvirt-guests,
so the situation you apparently find yourself in should
never, ever happen, barring a systemd bug.

Since you're running an Arch variant, I'm going to assume
all your software is basically at the latest version all
around, isn't it?

> just for info this is my libvirt-guests.service (by default)
> 
> [Unit]
> Description=Suspend Active Libvirt Guests
> After=network.target libvirtd.service time-sync.target
> Documentation=man:libvirtd(8)
> Documentation=http://libvirt.org
> 
> [Service]
> EnvironmentFile=-/etc/conf.d/libvirt-guests
> # Hack just call traditional service until we factor
> # out the code
> ExecStart=/usr/lib/libvirt/libvirt-guests.sh start
> ExecStop=/usr/lib/libvirt/libvirt-guests.sh stop
> Type=oneshot
> RemainAfterExit=yes
> StandardOutput=journal+console
> TimeoutStopSec=0
> 
> [Install]
> WantedBy=multi-user.target

Can you try adding

  [Unit]
  Requires=libvirtd.service

to your libvirt-guests.service via 'systemctl edit' and
see if it helps? I don't think it should be needed for your
use case, but it's probably a good idea to have it there
anyways.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvirt-users mailing list