[whatsup] try making systemd things work
David Brown
dmlb2000 at fedoraproject.org
Mon Sep 10 15:23:41 UTC 2012
commit a773a25d2187ef6fbe0654fc6535c9dd11bedaa7
Author: David Brown <david.brown at pnnl.gov>
Date: Mon Sep 10 08:23:05 2012 -0700
try making systemd things work
whatsup.spec | 44 +++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 11 deletions(-)
---
diff --git a/whatsup.spec b/whatsup.spec
index e4436ae..64c2015 100644
--- a/whatsup.spec
+++ b/whatsup.spec
@@ -9,7 +9,7 @@
Summary: Node up/down detection utility
Name: whatsup
Version: 1.13
-Release: 4%{?dist}
+Release: 5%{?dist}
Group: Applications/Communications
License: GPLv2+
URL: https://computing.llnl.gov/linux/whatsup.html
@@ -173,39 +173,58 @@ rm -rf %{buildroot}
%postun -n %{libname} -p /sbin/ldconfig
%post -n %{name}-pingd
+%if 0%{?fedora} > 15
+%if 0%{?fedora} > 17
+%systemd_post whatsup-pingd.service
+%else
if [ $1 -eq 1 ] ; then
# Initial installation
-%if 0%{?fedora} > 15
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-%else
- /sbin/chkconfig --add whatsup-pingd
+fi
%endif
+%else # EPEL thing
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /sbin/chkconfig --add whatsup-pingd
fi
+%endif
%preun -n %{name}-pingd
+%if 0%{?fedora} > 15
+%if 0%{?fedora} > 17
+%systemd_preun whatsup-pingd.service
+%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
-%if 0%{?fedora} > 15
/bin/systemctl --no-reload disable whatsup-pingd.service > /dev/null 2>&1 || :
/bin/systemctl stop whatsup-pingd.service > /dev/null 2>&1 || :
-%else
+fi
+%endif
+%else # EPEL thing
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
/sbin/service whatsup-pingd stop >/dev/null 2>&1 || :
/sbin/chkconfig --del whatsup-pingd >/dev/null 2>&1 || :
-%endif
fi
+%endif
%postun -n %{name}-pingd
%if 0%{?fedora} > 15
+%if 0%{?fedora} > 17
+%systemd_postun whatsup-pingd.service
+%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-%endif
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
-%if 0%{?fedora} > 15
/bin/systemctl try-restart whatsup-pingd.service >/dev/null 2>&1 || :
-%else
- /sbin/service whatsup-pingd condrestart
+fi
%endif
+%else #EPEL thing
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /sbin/service whatsup-pingd condrestart
fi
+%endif
%if 0%{?fedora} > 15
%triggerun -n %{name}-pingd -- whatsup-pingd < 1.12-6
@@ -293,6 +312,9 @@ fi
%changelog
+* Mon Sep 10 2012 David Brown <david.brown at pnnl.gov> - 1.13-5
+- add systemd macros to post postun preun
+
* Thu Aug 9 2012 David Brown <david.brown at pnnl.gov> - 1.13-4
- add dependancies for EPEL 5/6 service and chkconfig
- fixes bug #844900
More information about the scm-commits
mailing list