]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpm: Remove custom libvirtd restart logic
authorAndrea Bolognani <abologna@redhat.com>
Wed, 5 Jul 2023 15:37:34 +0000 (17:37 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 27 Jul 2023 16:02:56 +0000 (18:02 +0200)
This logic was necessary when socket activation was introduced
in libvirt 5.6.0/5.7.0 in order to guarantee smooth upgrades.

These days, even the oldest platform that we target ships a
version of libvirtd that implements socket activation, so the
additional code is no longer useful and we can treat libvirtd
the same as all other services.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
libvirt.spec.in

index c9317ed0cc10130ae1b537f42298c23cc0dbd86f..d09c3b3340fd4983462fcec0eb69df62658cbb7f 100644 (file)
@@ -1492,39 +1492,7 @@ fi \
 
 %posttrans daemon
 %libvirt_sysconfig_posttrans libvirtd
-if test %libvirt_daemon_needs_restart libvirtd
-then
-    # See if user has previously modified their install to
-    # tell libvirtd to use --listen
-    grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd 1>/dev/null 2>&1
-    if test $? = 0
-    then
-        # Then lets keep honouring --listen and *not* use
-        # systemd socket activation, because switching things
-        # might confuse mgmt tool like puppet/ansible that
-        # expect the old style libvirtd
-        /bin/systemctl mask \
-                libvirtd.socket \
-                libvirtd-ro.socket \
-                libvirtd-admin.socket \
-                libvirtd-tls.socket \
-                libvirtd-tcp.socket >/dev/null 2>&1 || :
-        /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || :
-    else
-        # Old libvirtd owns the sockets and will delete them on
-        # shutdown. Can't use a try-restart as libvirtd will simply
-        # own the sockets again when it comes back up. Thus we must
-        # do this particular ordering, so that we get libvirtd
-        # running with socket activation in use
-        /bin/systemctl stop libvirtd.service >/dev/null 2>&1 || :
-        /bin/systemctl try-restart \
-                libvirtd.socket \
-                libvirtd-ro.socket \
-                libvirtd-admin.socket >/dev/null 2>&1 || :
-        /bin/systemctl start libvirtd.service >/dev/null 2>&1 || :
-    fi
-fi
-%libvirt_daemon_finish_restart libvirtd
+%libvirt_daemon_perform_restart libvirtd
 
 %preun daemon
 %libvirt_daemon_systemd_preun_inet libvirtd