libvirt/src/remote
Peter Krempa 9c800d62ad remote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit
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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
2022-01-19 16:54:33 +01:00
..
libvirtd-admin.socket.in
libvirtd-ro.socket.in
libvirtd-tcp.socket.in
libvirtd-tls.socket.in
libvirtd.aug.in daemon: add tcp_min_ssf option 2021-11-04 17:02:56 +01:00
libvirtd.conf.in Add suggestions for virt-pki-query-dn usage 2021-11-12 12:37:29 +01:00
libvirtd.confd
libvirtd.init.in
libvirtd.libxl.logrotate.in
libvirtd.logrotate.in
libvirtd.lxc.logrotate.in
libvirtd.policy
libvirtd.qemu.logrotate.in
libvirtd.rules
libvirtd.sasl docs: stop mentioning insecure / broken SASL mechanisms 2021-03-17 09:31:57 +00:00
libvirtd.service.in remove sysconfig files 2022-01-17 18:20:59 +01:00
libvirtd.socket.in remote: systemd: Remove unix sockets from filesystem when disabling a '.socket' unit 2022-01-19 16:54:33 +01:00
libvirtd.sysctl
lxc_protocol.x
meson.build remove sysconfig files 2022-01-17 18:20:59 +01:00
qemu_protocol.x
remote_daemon_config.c remote_daemon: Validate tcp_min_ssf value only if found in config 2021-11-05 14:46:48 +01:00
remote_daemon_config.h daemon: add tcp_min_ssf option 2021-11-04 17:02:56 +01:00
remote_daemon_dispatch.c Prefer g_auto(GStrv) over g_strfreev() 2021-11-11 16:16:17 +01:00
remote_daemon_dispatch.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
remote_daemon_stream.c virStreamInData: Allow callback to not rewind the stream 2021-12-13 14:49:02 +01:00
remote_daemon_stream.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
remote_daemon.c Print errors on daemon startup if logging setup fails 2022-01-13 15:43:13 +01:00
remote_daemon.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
remote_driver.c remote: Add RPC support for the virDomainSetLaunchSecurityState API 2022-01-04 10:56:00 -07:00
remote_driver.h remote: warn on low SSF 2021-11-04 17:02:56 +01:00
remote_protocol.x remote: Add RPC support for the virDomainSetLaunchSecurityState API 2022-01-04 10:56:00 -07:00
remote_sockets.c remote: Avoid crash in remoteSplitURIScheme() 2021-12-10 14:15:23 +01:00
remote_sockets.h remote: extract logic for probing for modular daemons 2021-06-18 16:19:42 +01:00
remote_ssh_helper.c util: Check for errors in virLogSetFromEnv 2022-01-05 14:08:40 +01:00
test_libvirtd.aug.in daemon: add tcp_min_ssf option 2021-11-04 17:02:56 +01:00
virt-guest-shutdown.target Revert "remote: Add libvirtd dependency to virt-guest-shutdown.target" 2021-01-29 10:39:33 -07:00
virtproxyd.confd
virtproxyd.init.in
virtproxyd.service.in remove sysconfig files 2022-01-17 18:20:59 +01:00