[Libvirt-cim] [PATCH 07/10] libvirt-cim.spec: Use systemctl for tog-pegasus restart

John Ferlan jferlan at redhat.com
Thu Mar 14 22:55:59 UTC 2013


For Fedora 17 and RHEL7 use systemd, so change the pegasus startup to use
that and make a dependency upon it.
---
 libvirt-cim.spec.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in
index 7652dee..0679d7f 100644
--- a/libvirt-cim.spec.in
+++ b/libvirt-cim.spec.in
@@ -27,6 +27,9 @@ BuildRequires: libconfig-devel
 
 BuildRequires: libxml2-devel
 BuildRequires: libcmpiutil-devel
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
+BuildRequires: systemd-units
+%endif
 BuildConflicts: sblim-cmpi-devel
 
 %description
@@ -85,7 +88,12 @@ rm -fr $RPM_BUILD_ROOT
 
 %{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
 
-/etc/init.d/tog-pegasus condrestart
+# Fedora 17 / RHEL-7 are first where we use systemd.
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
+    systemctl restart tog-pegasus
+%else
+    /etc/init.d/tog-pegasus condrestart
+%endif
 
 %{_datadir}/%{name}/provider-register.sh -t pegasus \
 	-n @CIM_VIRT_NS@ \
-- 
1.8.1.4




More information about the Libvirt-cim mailing list