Scritping changes to manage the service with systemd

This commit is contained in:
praveenp 2011-01-07 17:38:19 -06:00
parent 02eb3d99ed
commit 0ccae6251f
1 changed files with 28 additions and 7 deletions

View File

@ -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 <praveen_paladugu@dell.com> - 1.3.10-3
- Added the required scripting to manage the service with systemd
* Fri Jan 7 2011 Praveen K Paladugu <praveen_paladugu@dell.com> - 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,