From 026a8b4a3a7670ae89114204bb6c1f6808ee7c86 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mar 21 2012 16:59:30 +0000 Subject: get rid of posttrans - move update code to post --- diff --git a/389-ds-base.spec b/389-ds-base.spec index 6b9fea0..d5d59aa 100644 --- a/389-ds-base.spec +++ b/389-ds-base.spec @@ -16,7 +16,7 @@ Summary: 389 Directory Server (base) Name: 389-ds-base Version: 1.2.10.4 -Release: %{?relprefix}1%{?prerel}%{?dist} +Release: %{?relprefix}2%{?prerel}%{?dist} License: GPLv2 with exceptions URL: http://port389.org/ Group: System Environment/Daemons @@ -181,22 +181,8 @@ rm -rf $RPM_BUILD_ROOT /sbin/chkconfig --add %{pkgname} /sbin/ldconfig /sbin/chkconfig --add %{pkgname}-snmp - -%preun -if [ $1 = 0 ]; then # Final removal - /sbin/service %{pkgname} stop >/dev/null 2>&1 || : - /sbin/chkconfig --del %{pkgname} - /sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || : - /sbin/chkconfig --del %{pkgname}-snmp -fi - -%postun -/sbin/ldconfig -if [ $1 = 0 ]; then # Final removal - rm -rf /var/run/%{pkgname} -fi - -%posttrans +# restart the snmp subagent if needed +/sbin/service %{pkgname}-snmp condrestart > /dev/null 2>&1 instbase="%{_sysconfdir}/%{pkgname}" # echo posttrans - upgrading - looking for instances in $instbase # find all instances @@ -232,10 +218,22 @@ for inst in $instances ; do # echo restarting instance $inst /sbin/service %{pkgname} start $inst >/dev/null 2>&1 done -# restart the snmp subagent if needed -/sbin/service %{pkgname}-snmp condrestart > /dev/null 2>&1 exit 0 +%preun +if [ $1 = 0 ]; then # Final removal + /sbin/service %{pkgname} stop >/dev/null 2>&1 || : + /sbin/chkconfig --del %{pkgname} + /sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || : + /sbin/chkconfig --del %{pkgname}-snmp +fi + +%postun +/sbin/ldconfig +if [ $1 = 0 ]; then # Final removal + rm -rf /var/run/%{pkgname} +fi + %files %defattr(-,root,root,-) %doc LICENSE EXCEPTION LICENSE.GPLv2 @@ -277,6 +275,9 @@ exit 0 %{_libdir}/%{pkgname}/libslapd.so.* %changelog +* Wed Mar 21 2012 Rich Megginson - 1.2.10.4-2 +- get rid of posttrans - move update code to post + * Tue Mar 13 2012 Rich Megginson - 1.2.10.4-1 - Ticket #305 - Certain CMP operations hang or cause ns-slapd to crash