From 0ccae6251f79db0cd94f62538685a3bac266437c Mon Sep 17 00:00:00 2001 From: praveenp Date: Fri, 7 Jan 2011 17:38:19 -0600 Subject: [PATCH] Scritping changes to manage the service with systemd --- sblim-sfcb.spec | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/sblim-sfcb.spec b/sblim-sfcb.spec index 24f511b..c65aa96 100644 --- a/sblim-sfcb.spec +++ b/sblim-sfcb.spec @@ -8,7 +8,7 @@ Name: sblim-sfcb Summary: Small Footprint CIM Broker URL: http://www.sblim.org Version: 1.3.10 -Release: 2%{?dist} +Release: 3%{?dist} Group: Applications/System License: EPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} @@ -27,6 +27,10 @@ BuildRequires: openssl-devel BuildRequires: pam-devel BuildRequires: cim-schema BuildRequires: bison flex +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +Requires(triggerun): systemd-units %Description Small Footprint CIM Broker (sfcb) is a CIM server conforming to the @@ -99,18 +103,32 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/sfcb/genSslCert.sh %{_sysconfdir}/sfcb &>/dev/null || : /sbin/ldconfig %{_bindir}/sfcbrepos -f -/sbin/chkconfig --add sblim-sfcb + +if [ $1 -eq 1 ]; then + # Package install, not upgrade + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi + +%triggerun -- sblim-sfcb < 1.3.10-3 +if /sbin/chkconfig sblim-sfcb ; then + /bin/systemctl enable sfcb.service >/dev/null 2>&1 || : +fi %preun -if [ $1 = 0 ]; then - /sbin/service sblim-sfcb stop&>/dev/null - /sbin/chkconfig --del sblim-sfcb +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl disable sfcb.service > /dev/null 2>&1 || : + /bin/systemctl stop sfcb.service > /dev/null 2>&1 || : fi + %postun /sbin/ldconfig -if [ $1 -gt 1 ]; then - /sbin/service sblim-sfcb condrestart|try-restart &> /dev/null + +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart sfcb.service >/dev/null 2>&1 || : fi %files -f _pkg_list @@ -123,6 +141,9 @@ fi #%doc COPYING README %changelog +* Fri Jan 7 2011 Praveen K Paladugu - 1.3.10-3 +- Added the required scripting to manage the service with systemd + * Fri Jan 7 2011 Praveen K Paladugu - 1.3.10-2 - Following the BZ#660072, added sfcb.service file for compliance with systemd - Since sfcb's PAM authentication requires, the user to be in group sfcb,