From ae7aa36f61061a67b3ae02abcac5f10e212c26ac Mon Sep 17 00:00:00 2001 From: Michal Bielicki Date: Sat, 21 Nov 2009 00:04:27 +0000 Subject: [PATCH] Patch to freeswitch.spec by Igor Neves fixing useradd and userdel on Linux, Thank you git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15586 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- freeswitch.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/freeswitch.spec b/freeswitch.spec index 68339148e2..4b04e89f9e 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -408,7 +408,10 @@ touch .noversion # Add a freeswitch user with group daemon %pre %ifos linux -/usr/sbin/useradd -r -g daemon -s /bin/false -c "The FreeSWITCH Open Source Voice Platform" -d %{prefix} freeswitch 2> /dev/null || : +if ! /usr/bin/id freeswitch &>/dev/null; then + /usr/sbin/useradd -r -g daemon -s /bin/false -c "The FreeSWITCH Open Source Voice Platform" -d %{prefix} freeswitch || \ + %logmsg "Unexpected error adding user \"freeswitch\". Aborting installation." +fi %endif %post @@ -421,7 +424,9 @@ chkconfig --add freeswitch %postun %{?run_ldconfig:%run_ldconfig} -userdel freeswitch +if [ $1 -eq 0 ]; then + userdel freeswitch || %logmsg "User \"freeswitch\" could not be deleted." +fi %clean %{__rm} -rf $RPM_BUILD_ROOT @@ -806,6 +811,8 @@ userdel freeswitch %changelog +* Sat Nov 21 2009 - michal.bielicki@seventhsignal.de +- added patch by Igor Neves : Added some checkup in %post and %postun to prevent upgrades from removing freeswitch user * Thu Nov 18 2009 - michal.bielicki@seventhsignal.de - added new config files for diretory and distributor - removed sangoma boost from openzap for builds that do not inherit wanpipe while building.