You are not logged in.

#1 2024-12-15 17:45:36

axl-devhub
Member
Registered: 2024-12-15
Posts: 4

[SOLVED] Arch takes 5-8 seconds to shutdown or reboot

For some time, 2 weeks or so, whenever I tried to shutdown or reboot Arch, it took around 5-8 seconds, whereas normally as soon as I invoked the shutdown or reboot command, the screen would instantly go dark and complete the shutdown process.

Upon further investigation i found that it has something to do with libvirt because  when I disable or stop the libvirt service, my system reboots normally.

I have checked the journalctl logs, but I cannot find any relevant error messages related to libvirtd, except for my VM definitions.

When I re-enable the libvirtd service, the issue persists.

Thanks in advance, i am confused why this is happening

Edit:

This was a libvirt problem, fixed by downgrading from version 10.0.9 to version 10.0.8 (https://archive.archlinux.org/packages/ … kg.tar.zst)

sudo pacman -U libvirt-1%3A10.8.0-1-x86_64.pkg.tar.zst

Last edited by axl-devhub (2024-12-22 18:16:20)

Offline

#2 2024-12-15 18:03:50

cryptearth
Member
Registered: 2024-02-03
Posts: 2,161

Re: [SOLVED] Arch takes 5-8 seconds to shutdown or reboot

do you have any vm auto start on system boot?
is there any vm running when you want to reboot?
dont assume - check with

sudo virsh list --all

Offline

#3 2024-12-15 18:29:57

axl-devhub
Member
Registered: 2024-12-15
Posts: 4

Re: [SOLVED] Arch takes 5-8 seconds to shutdown or reboot

I don't have any VMs auto starting on system boot.

This is the output of sudo virsh list --all

sudo virsh list --all
 Id   Name         State
-----------------------------
 -    kali-linux   shut off
 -    win11-base   shut off

And running systemctl status on libvirtd yields this

● libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: active (running) since Sun 2024-12-15 13:35:36 AST; 54min ago
 Invocation: d6588d2f35b84a61a6868e76c3db6fbb
TriggeredBy: ● libvirtd.socket
             ● libvirtd-admin.socket
             ● libvirtd-ro.socket
       Docs: man:libvirtd(8)
             https://libvirt.org/
   Main PID: 789 (libvirtd)
      Tasks: 23 (limit: 32768)
     Memory: 77.1M (peak: 77.8M)
        CPU: 545ms
     CGroup: /system.slice/libvirtd.service
             ├─ 789 /usr/bin/libvirtd --timeout 120
             ├─1051 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
             └─1052 /usr/bin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper

Dec 15 13:35:37 archlinux dnsmasq[1051]: read /etc/hosts - 1 names
Dec 15 13:35:37 archlinux dnsmasq[1051]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Dec 15 13:35:37 archlinux dnsmasq-dhcp[1051]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Dec 15 13:35:36 archlinux systemd[1]: Starting libvirt legacy monolithic daemon...
Dec 15 13:35:36 archlinux systemd[1]: Started libvirt legacy monolithic daemon.
Dec 15 13:35:41 archlinux dnsmasq[1051]: reading /etc/resolv.conf
Dec 15 13:35:41 archlinux dnsmasq[1051]: using nameserver 192.168.1.1#53
Dec 15 13:35:43 archlinux dnsmasq[1051]: reading /etc/resolv.conf
Dec 15 13:35:43 archlinux dnsmasq[1051]: using nameserver 192.168.1.1#53
Dec 15 13:35:43 archlinux dnsmasq[1051]: using nameserver 2001:1308:27f8:e301:6238:e0ff:fea2:9c5#53

Thanks in advance

Offline

#4 2024-12-19 18:09:00

axl-devhub
Member
Registered: 2024-12-15
Posts: 4

Re: [SOLVED] Arch takes 5-8 seconds to shutdown or reboot

Researching a bit further on my logs when shutting down i found this

journalctl -b -1 | grep -i "libvirt"
[sudo] password for axl-devhub:
Dec 19 13:22:50 archlinux sudo[759]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/virsh define /etc/libvirt/qemu/win11-base-with-gpu.xml
Dec 19 13:22:53 archlinux definevm.sh[773]: Domain 'win11-base' defined from /etc/libvirt/qemu/win11-base-with-gpu.xml
Dec 19 13:22:51 archlinux dnsmasq[1049]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Dec 19 13:22:51 archlinux dnsmasq-dhcp[1049]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt legacy monolithic daemon socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt legacy monolithic daemon admin socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt legacy monolithic daemon read-only socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt locking daemon socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt locking daemon admin socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt logging daemon socket.
Dec 19 13:22:50 archlinux systemd[1]: Listening on libvirt logging daemon admin socket.
Dec 19 13:22:50 archlinux systemd[1]: Starting libvirt logging daemon...
Dec 19 13:22:50 archlinux systemd[1]: Started libvirt logging daemon.
Dec 19 13:22:51 archlinux systemd[1]: Starting libvirt legacy monolithic daemon...
Dec 19 13:22:51 archlinux systemd[1]: Started libvirt legacy monolithic daemon.
Dec 19 13:26:41 archlinux systemd-logind[692]: Delay lock is active (UID 0/root, PID 793/libvirtd) but inhibitor timeout is reached.
Dec 19 13:26:41 archlinux systemd[1]: Stopping libvirt legacy monolithic daemon...
Dec 19 13:26:41 archlinux systemd[1]: Stopping libvirt logging daemon...
Dec 19 13:26:41 archlinux systemd[1]: Stopped libvirt logging daemon.
Dec 19 13:26:41 archlinux systemd[1]: libvirtd.service: Deactivated successfully.
Dec 19 13:26:41 archlinux systemd[1]: libvirtd.service: Unit process 1049 (dnsmasq) remains running after unit stopped.
Dec 19 13:26:41 archlinux systemd[1]: libvirtd.service: Unit process 1050 (dnsmasq) remains running after unit stopped.
Dec 19 13:26:41 archlinux systemd[1]: Stopped libvirt legacy monolithic daemon.
Dec 19 13:26:44 archlinux systemd[1]: libvirtd-admin.socket: Deactivated successfully.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt legacy monolithic daemon admin socket.
Dec 19 13:26:44 archlinux systemd[1]: libvirtd-ro.socket: Deactivated successfully.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt legacy monolithic daemon read-only socket.
Dec 19 13:26:44 archlinux systemd[1]: libvirtd.socket: Deactivated successfully.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt legacy monolithic daemon socket.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt locking daemon admin socket.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt locking daemon socket.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt logging daemon admin socket.
Dec 19 13:26:44 archlinux systemd[1]: Closed libvirt logging daemon socket.

And i found that the difference in seconds between this log

Dec 19 13:26:41 archlinux systemd-logind[692]: Delay lock is active (UID 0/root, PID 793/libvirtd) but inhibitor timeout is reached.

And this one

Dec 19 13:26:44 archlinux systemd[1]: libvirtd-admin.socket: Deactivated successfully.

Is about 5 seconds, checking my inhibitor logs i found this:

systemd-inhibit --list
WHO            UID  USER       PID  COMM           WHAT     WHY
                                     MODE
Libvirt        0    root       792  libvirtd       shutdown Virtual machines need to be saved         delay
NetworkManager 0    root       680  NetworkManager sleep    NetworkManager needs to turn off networks delay
UPower         0    root       2192 upowerd        sleep    Pause device polling                      delay
code           1000 axl-devhub 3328 code           sleep    Application cleanup before suspend        delay
4 inhibitors listed.

Offline

Board footer

Powered by FluxBB