]> xenbits.xensource.com Git - libvirt.git/commitdiff
spec: Remove duplicate check of libvirtd status
authorJim Fehlig <jfehlig@suse.com>
Tue, 19 Jul 2022 23:10:01 +0000 (17:10 -0600)
committerJim Fehlig <jfehlig@suse.com>
Mon, 1 Aug 2022 17:26:35 +0000 (11:26 -0600)
The %posttrans scriptlet checks if libvirtd is active within a
condition that is only executed if libvirtd is active. Remove the
duplicate check.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
libvirt.spec.in

index 9d788b790f757fa01cd28577f90e8d66bce17f76..a238edf2aae436a62393ad62fa7f58d265901daa 100644 (file)
@@ -1365,18 +1365,12 @@ then
         # 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 is-active libvirtd.service 1>/dev/null 2>&1
-        if test $? = 0
-        then
-            /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
+        /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