From ae46b032fd8c9958ff95b495ce114f57636e42ca Mon Sep 17 00:00:00 2001 From: "Tom \"spot\" Callaway" Date: Fri, 9 Sep 2011 12:14:32 -0400 Subject: [PATCH] fix systemd scriptlets --- freeradius.spec | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/freeradius.spec b/freeradius.spec index 8603a28..8189d05 100644 --- a/freeradius.spec +++ b/freeradius.spec @@ -1,7 +1,7 @@ Summary: High-performance and highly configurable free RADIUS server Name: freeradius Version: 2.1.11 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Daemons URL: http://www.freeradius.org/ @@ -35,6 +35,9 @@ BuildRequires: systemd-units Requires(pre): shadow-utils glibc-common Requires(post): systemd-sysv +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units %description The FreeRADIUS Server Project is a high performance and highly configurable @@ -249,14 +252,27 @@ exit 0 %post if [ $1 -eq 1 ]; then # install + # Initial installation + /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ ! -e /etc/raddb/certs/server.pem ]; then /sbin/runuser -g radiusd -c 'umask 007; /etc/raddb/certs/bootstrap' > /dev/null 2>&1 fi fi exit 0 +%preun +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable radiusd.service > /dev/null 2>&1 || : + /bin/systemctl stop radiusd.service > /dev/null 2>&1 || : +fi + %postun -if [ $1 -eq 0 ]; then # uninstall +/bin/systemctl daemon-reload >/dev/null 2>&1 || : +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart radiusd.service >/dev/null 2>&1 || : +elif [ $1 -eq 0 ]; then # uninstall getent passwd radiusd >/dev/null && /usr/sbin/userdel radiusd > /dev/null 2>&1 getent group radiusd >/dev/null && /usr/sbin/groupdel radiusd > /dev/null 2>&1 fi @@ -562,6 +578,9 @@ exit 0 %{_libdir}/freeradius/rlm_sql_unixodbc-%{version}.so %changelog +* Fri Sep 9 2011 Tom Callaway - 2.1.11-6 +- add missing systemd scriptlets + * Thu Sep 8 2011 Tom Callaway - 2.1.11-5 - convert to systemd