]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
spec: Start libvirt-guests only if it's on in current runlevel
authorJiri Denemark <jdenemar@redhat.com>
Tue, 18 Jan 2011 08:49:10 +0000 (09:49 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 19 Jan 2011 14:01:52 +0000 (15:01 +0100)
libvirt.spec.in

index d673cf66397ab5bf6c86cf578e162b88c2cc6147..0a2d10ea0b8183f65d00a849b2a3c8144e267755 100644 (file)
@@ -775,7 +775,8 @@ fi
 /sbin/ldconfig
 /sbin/chkconfig --add libvirt-guests
 if [ $1 -ge 1 ]; then
-    if /sbin/chkconfig --list libvirt-guests | /bin/grep -q :on ; then
+    level=$(/sbin/runlevel | /bin/cut -d ' ' -f 2)
+    if /sbin/chkconfig --list libvirt-guests | /bin/grep -q $level: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