From a95340b20331e5417fb53e1e4792a476d3cc3368 Mon Sep 17 00:00:00 2001 From: John Dennis Date: Jan 01 2011 13:45:24 +0000 Subject: bug 666589 - removing freeradius from system does not delete the user "radiusd" fix scriptlet argument testing, simplify always exiting with zero --- diff --git a/freeradius.spec b/freeradius.spec index 516e035..36288b7 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.10 -Release: 1%{?dist} +Release: 3%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Daemons URL: http://www.freeradius.org/ @@ -244,30 +244,36 @@ rm -rf $RPM_BUILD_ROOT # Make sure our user/group is present prior to any package or subpackage installation %pre -getent group radiusd >/dev/null || /usr/sbin/groupadd -r -g 95 radiusd +getent group radiusd >/dev/null || /usr/sbin/groupadd -r -g 95 radiusd > /dev/null 2>&1 getent passwd radiusd >/dev/null || /usr/sbin/useradd -r -g radiusd -u 95 -c "radiusd user" -s /sbin/nologin radiusd > /dev/null 2>&1 exit 0 %post -if [ $1 = 1 ]; then +if [ $1 -eq 1 ]; then # install /sbin/chkconfig --add radiusd if [ ! -e /etc/raddb/certs/server.pem ]; then - /sbin/runuser -g radiusd -c 'umask 007; /etc/raddb/certs/bootstrap' > /dev/null 2>&1 || : + /sbin/runuser -g radiusd -c 'umask 007; /etc/raddb/certs/bootstrap' > /dev/null 2>&1 fi fi +exit 0 %preun -if [ $1 = 0 ]; then +if [ $1 -eq 0 ]; then # uninstall /sbin/service radiusd stop > /dev/null 2>&1 /sbin/chkconfig --del radiusd fi +exit 0 %postun -if [ $1 -ge 1 ]; then - /sbin/service radiusd condrestart >/dev/null 2>&1 || : +if [ $1 -ge 1 ]; then # upgrade + /sbin/service radiusd condrestart >/dev/null 2>&1 fi - +if [ $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 +exit 0 %files %defattr(-,root,root) @@ -559,6 +565,10 @@ fi %{_libdir}/freeradius/rlm_sql_unixodbc-%{version}.so %changelog +* Sat Jan 1 2011 John Dennis - 2.1.10-3 +- bug 666589 - removing freeradius from system does not delete the user "radiusd" + fix scriptlet argument testing, simplify always exiting with zero + * Tue Oct 19 2010 John Dennis - 2.1.10-1 Feature improvements * Install the "radcrypt" program.