52 lines
2.0 KiB
Diff
52 lines
2.0 KiB
Diff
From 65a4c1782b197787bb960427cf0106c8d8225777 Mon Sep 17 00:00:00 2001
|
|
From: Eric Blake <eblake@redhat.com>
|
|
Date: Tue, 6 Dec 2011 16:16:34 -0700
|
|
Subject: [PATCH 09/13] spec: don't use chkconfig --list
|
|
|
|
(direct cherry-pick of upstream commit fea83dd)
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=694403 reports that
|
|
the specfile is incorrectly checking for a running libvirt-guests
|
|
service. For example,
|
|
|
|
$ LC_ALL=es_ES chkconfig --list libvirt-guests
|
|
libvirt-guests 0:desactivado 1:desactivado 2:desactivado 3:activo 4:activo 5:activo 6:desactivado
|
|
|
|
will fail to find 5:on, even though it is active. But chkconfig
|
|
already has a mode where you can silently use the exit status to
|
|
check for an active service.
|
|
|
|
* libvirt.spec.in (%post): Use simpler chkconfig options, to avoid
|
|
issues with localization.
|
|
---
|
|
libvirt.spec.in | 6 ++----
|
|
1 files changed, 2 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/libvirt.spec.in b/libvirt.spec.in
|
|
index ba950c6..ad522bc 100644
|
|
--- a/libvirt.spec.in
|
|
+++ b/libvirt.spec.in
|
|
@@ -846,8 +846,7 @@ getent passwd qemu >/dev/null || \
|
|
# We want to install the default network for initial RPM installs
|
|
# or on the first upgrade from a non-network aware libvirt only.
|
|
# We check this by looking to see if the daemon is already installed
|
|
-/sbin/chkconfig --list libvirtd 1>/dev/null 2>&1
|
|
-if test $? != 0 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
|
+if ! /sbin/chkconfig libvirtd && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
|
then
|
|
UUID=`/usr/bin/uuidgen`
|
|
sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \
|
|
@@ -934,8 +933,7 @@ fi
|
|
/sbin/chkconfig --add libvirt-guests
|
|
if [ $1 -ge 1 ]; then
|
|
level=$(/sbin/runlevel | /bin/cut -d ' ' -f 2)
|
|
- if /sbin/chkconfig --list libvirt-guests 2>/dev/null \
|
|
- | /bin/grep -q $level:on ; then
|
|
+ if /sbin/chkconfig --levels $level libvirt-guests; 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.7.3
|
|
|