[PATCH] remote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit

Erik Skultety eskultet at redhat.com
Tue Jan 18 14:59:57 UTC 2022


On Tue, Jan 18, 2022 at 03:38:26PM +0100, Peter Krempa wrote:
> The existence of the unix socket path is used by the remote driver to
> determine whether modular daemons are in use, so if the socket file
> stays behind and the user decided to switch from modular to monolithic
> daemon which was socket activated, the remote driver will insist on
> picking '/var/run/libvirt/virtqemud-sock', even when it's no longer in
> use:
> 
>  # systemctl start libvirtd.service
>  # virsh list
>   Id   Name   State
>  --------------------
> 
>  # systemctl stop libvirtd.service
>  Warning: Stopping libvirtd.service, but it can still be activated by:
>    libvirtd.socket
>    libvirtd-ro.socket
>    libvirtd-admin.socket
>  # systemctl start virtqemud.socket
>  # virsh list
>   Id   Name   State
>  --------------------
> 
>  # systemctl stop virtqemud.socket
>  # systemctl start libvirtd.service
>  # virsh list
>  error: failed to connect to the hypervisor
>  error: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': Connection refused
> 
>  # virsh -c 'qemu:///system?socket=/var/run/libvirt/libvirt-sock' list
>   Id   Name   State
>  --------------------
> 
> Fix this by instructing systemd to delete the socket file when
> deactivating the unit file for the socket.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---

Yes, please, I've hit this a few times already in the past couple of days.
However - the service may still remain running when you stop the socket and as
the man page states, it should still be possible to communicate with the
service via the filesystem node, e.g. doing 'virsh list'.
But I agree this is very annoying and I don't particularly like wiping
/run/libvirt whenever I want to switch :( .

Erik

I'm still inclined to ACK the patch though...




More information about the libvir-list mailing list