[389-ds-base/f16] get rid of posttrans - move update code to post
Richard Allen Megginson
rmeggins at fedoraproject.org
Wed Mar 21 18:56:21 UTC 2012
commit b71537c26d98afb40fc941fbb9346b788db0ed09
Author: Rich Megginson <rmeggins at redhat.com>
Date: Wed Mar 21 08:40:33 2012 -0600
get rid of posttrans - move update code to post
389-ds-base.spec | 43 +++++++++++++++++++++++--------------------
1 files changed, 23 insertions(+), 20 deletions(-)
---
diff --git a/389-ds-base.spec b/389-ds-base.spec
index a854e96..b405a9d 100644
--- a/389-ds-base.spec
+++ b/389-ds-base.spec
@@ -19,7 +19,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
@@ -183,25 +183,12 @@ sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' $RPM_BUILD_ROOT%{_datadir}/%{pkgna
rm -rf $RPM_BUILD_ROOT
%post
+# reload to pick up any changes to systemd files
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+# reload to pick up any shared lib changes
/sbin/ldconfig
-
-%preun
-if [ $1 -eq 0 ]; then # Final removal
- # Package removal, not upgrade
- /bin/systemctl --no-reload disable %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || :
- /bin/systemctl stop %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || :
- # remove instance specific service files/links
- rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || :
-fi
-
-%postun
-/sbin/ldconfig
-if [ $1 = 0 ]; then # Final removal
- rm -rf /var/run/%{pkgname}
-fi
-
-%posttrans
+# restart the snmp subagent if needed
+/bin/systemctl try-restart %{pkgname}-snmp.service > $output 2>&1 || :
# find all instances
instances="" # instances that require a restart after upgrade
ninst=0 # number of instances found in total
@@ -239,10 +226,23 @@ for inst in $instances ; do
echo restarting instance $inst > $output 2>&1 || :
/bin/systemctl start $inst > $output 2>&1 || :
done
-# restart the snmp subagent if needed
-/bin/systemctl try-restart %{pkgname}-snmp.service > $output 2>&1 || :
exit 0
+%preun
+if [ $1 -eq 0 ]; then # Final removal
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || :
+ /bin/systemctl stop %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || :
+ # remove instance specific service files/links
+ rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || :
+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
@@ -285,6 +285,9 @@ exit 0
%{_libdir}/%{pkgname}/libslapd.so.*
%changelog
+* Wed Mar 21 2012 Rich Megginson <rmeggins at redhat.com> - 1.2.10.4-2
+- get rid of posttrans - move update code to post
+
* Tue Mar 13 2012 Rich Megginson <rmeggins at redhat.com> - 1.2.10.4-1
- Ticket #305 - Certain CMP operations hang or cause ns-slapd to crash
More information about the scm-commits
mailing list