]> xenbits.xensource.com Git - libvirt.git/commitdiff
spec: do not start libvirt-guests if that service is off
authorDan Kenigsberg <danken@redhat.com>
Tue, 7 Dec 2010 16:05:44 +0000 (18:05 +0200)
committerEric Blake <eblake@redhat.com>
Thu, 9 Dec 2010 23:55:48 +0000 (16:55 -0700)
starting a service during rpm installation is impolite. It is even worse if done
during upgrade, for a service that was explicitly turned off.

libvirt.spec.in

index 74e37b722d8277ec8222096562c93322618cd9c4..ddb50cde7dbe942e78927c5aa30ed97c45f27bae 100644 (file)
@@ -744,9 +744,11 @@ fi
 /sbin/ldconfig
 /sbin/chkconfig --add libvirt-guests
 if [ $1 -ge 1 ]; then
-    # this doesn't do anything but allowing for libvirt-guests to be
-    # stopped on the first shutdown
-    /sbin/service libvirt-guests start > /dev/null 2>&1 || true
+    if /sbin/chkconfig --list libvirt-guests | /bin/grep -q :on ; then
+        # this doesn't do anything but allowing for libvirt-guests to be
+        # stopped on the first shutdown
+        /sbin/service libvirt-guests start > /dev/null 2>&1 || true
+    fi
 fi
 
 %postun client -p /sbin/ldconfig