[libvirt] [PATCH] spec: Start libvirt-guests only if it's on in current runlevel

--- libvirt.spec.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index d673cf6..0a2d10e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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 -- 1.7.4.rc2

On 01/19/2011 07:04 AM, Jiri Denemark wrote:
--- libvirt.spec.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index d673cf6..0a2d10e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Wed, Jan 19, 2011 at 07:47:35 -0700, Eric Blake wrote:
On 01/19/2011 07:04 AM, Jiri Denemark wrote:
--- libvirt.spec.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index d673cf6..0a2d10e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -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
ACK.
Pushed, thanks. Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark