]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
spec: Drop overlapping triggers
authorJiri Denemark <jdenemar@redhat.com>
Wed, 14 Feb 2018 12:16:52 +0000 (13:16 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 14 Feb 2018 14:55:18 +0000 (15:55 +0100)
The postun trigger for libvirt-daemon was defined twice for overlapping
ranges of package verions if systemd support was switched off (which
happens when building on something ancient, such as RHEL-6).

Let's combine the two triggers into the one which is called when
libvirt-daemon < 1.3.0 is uninstalled. As a side effect, virtlockd and
virtlogd might be reloaded twice after an upgrade from libvirt newer
than 1.2.1 and older than 1.3.0 (by postun script from the old libvirt
and postun trigger from the new libvirt).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
libvirt.spec.in

index f73fcab49412be4838e2307b3453ca5f0a466e97..e1e902c5e4c60fb8ffd0504fe7656e5d284b1c56 100644 (file)
@@ -1599,15 +1599,6 @@ if [ $1 -ge 1 ]; then
 fi
 %endif
 
-%if %{with_systemd}
-%else
-%triggerpostun daemon -- libvirt-daemon < 1.2.1
-if [ "$1" -ge "1" ]; then
-    /sbin/service virtlockd reload > /dev/null 2>&1 || :
-    /sbin/service virtlogd reload > /dev/null 2>&1 || :
-fi
-%endif
-
 # In upgrade scenario we must explicitly enable virtlockd/virtlogd
 # sockets, if libvirtd is already enabled and start them if
 # libvirtd is running, otherwise you'll get failures to start
@@ -1624,6 +1615,8 @@ if [ $1 -ge 1 ] ; then
         /sbin/chkconfig virtlogd on || :
     /sbin/service libvirtd status 1>/dev/null 2>&1 &&
         /sbin/service virtlogd start || :
+    /sbin/service virtlockd reload > /dev/null 2>&1 || :
+    /sbin/service virtlogd reload > /dev/null 2>&1 || :
 %endif
 fi