Closed bjornfor closed 8 years ago
It's possible that libvirtd requires some additional time for cleaning up after stop
, hence not even your manual restart
worked because it was too fast. That's just supposition though.
It might be. But normal service restarts are generally quick (I can do sudo systemctl restart libvirtd
in <1 second). I think the issue only appears when libvirtd starts running from a new/different store path.
But I'll keep an eye on it (the time).
On Sunday, August 16, 2015, Bjørn Forsman notifications@github.com wrote:
It might be. But normal service restarts are generally quick (I can do sudo systemctl restart libvirtd in <1 second).
Systemd is quite async. Doing systemcltl start may return immediately but still do something in the background for several seconds.
NixOS Linux http://nixos.org
I concidered that. But there is a --no-block option for systemctl, indicating that the default is to block. Using --no-block reduces a systemctl restart libvirtd
operation from ~0.5 seconds down to 20 ms. Further, the journal output for libvirtd service while restarting it shows that the whole thing completes within one second:
Aug 16 11:03:33 mini systemd[1]: Stopping Libvirt Virtual Machine Management Daemon...
Aug 16 11:03:33 mini systemd[1]: Starting Libvirt Virtual Machine Management Daemon...
Aug 16 11:03:33 mini dnsmasq[5287]: read /etc/hosts - 13862 addresses
Aug 16 11:03:33 mini dnsmasq[5287]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Aug 16 11:03:33 mini dnsmasq-dhcp[5287]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Aug 16 11:03:33 mini systemd[1]: Started Libvirt Virtual Machine Management Daemon.
But I do find it a bit odd that restarting libvirtd takes less than one second. I would have guessed it took longer.
Wait... there is also the "libvirt-guests" service involved here. (That service probably takes longer to start.) Looking at the "nixos-rebuild switch" output from above, I see NOT restarting the following changed units: ... libvirt-guests.service
. That might be a clue.
(triage) does this still happen?
Don't know, haven't paid much attention to the libvirtd service lately. I'll reopen if I notice it again.
I've seen several times that
nixos-rebuild switch --upgrade
(if the upgrade is "big enough") can cause libvirtd to fail.Here is one from today (updating on the 14.12 branch):
This one fixed itself with one additional
sudo systemctl restart libvirtd
. But I've also had this error where this manual workaround did not work, and I've simply rebooted the machine :-(