Skip to content

libvirtd socket activation not working since 253.5 #27953

@lkrms

Description

@lkrms

systemd version the issue has been seen with

253.5

Used distribution

Arch Linux (rolling)

Linux kernel version used

6.3.5-arch1-1

CPU architectures issue was seen on

x86_64

Component

systemd

Expected behaviour you didn't see

In its default configuration, libvirtd.service starts a libvirtd process that times out after 120 seconds of inactivity (no running domains and no connected clients). The service remains active and libvirtd is respawned on-demand via systemd socket activation (libvirtd-ro.socket, libvirtd.socket and libvirtd-admin.socket correspond to /var/lib/libvirt/{libvirt-sock-ro,libvirt-sock,libvirt-admin-sock}` respectively by default).

Unexpected behaviour you saw

After updating from systemd 253.4 to 253.5, socket activation stopped working. Attempting to connect to libvirtd via a socket after it times out yields nothing. Client software (I'm using virsh and virt-manager on the same host) halts indefinitely as soon as a libvirtd-dependent command is issued, and no errors are reported or logged before or after they are terminated (e.g. with Ctrl+C), including by systemd.

If systemctl restart libvirtd.service is issued in a separate terminal, libvirtd starts as normal and any processes trying to connect via a socket succeed immediately (there is no need to cancel the attempt and try again).

After rolling back systemd, libvirt and other updates installed at the same time in various combinations, the culprit appears to be systemd 253.5. Downgrading to 253.4 restores the desired behaviour.

Steps to reproduce the problem

  • Install a libvirt package with stock systemd unit files
  • Start libvirtd and/or enable its sockets as needed
  • Wait for the libvirtd process to terminate after 2 minutes
  • Run sudo virsh list or similar
  • Wait indefinitely

Additional program output to the terminal or log subsystem illustrating the issue

Here's output from strace, in the absence of anything appearing in a log entry:

https://gist.github.com/lkrms/5bb9ef2e7ad8aa5d89e164b6e3f4d4a6#file-gistfile1-txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingpid1regression ⚠️A bug in something that used to work correctly and broke through some recent commit

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions