summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2011-03-16 10:36:41 -0400
committerTodd Zullinger <tmz@pobox.com>2011-03-16 10:36:41 -0400
commit6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1 (patch)
tree85c0021f55d1e405faf45515344e3a7854528cbd
parent9bf6b15a1edba1b35a85099317a4b665e8da3a17 (diff)
downloadpuppet-package-6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1.tar.gz
puppet-package-6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1.tar.xz
puppet-package-6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1.zip
Properly restart puppet agent/master daemons on upgrades from 0.25.x
The pidfile changed from 0.25.x to 2.6.x. Attempt to handle upgrades without leaving the old process running.
-rw-r--r--puppet.spec21
1 files changed, 21 insertions, 0 deletions
diff --git a/puppet.spec b/puppet.spec
index 9e2d2d3..f3776ec 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -193,9 +193,29 @@ exit 0
%post
/sbin/chkconfig --add puppet || :
+if [ "$1" -ge 1 ]; then
+ # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving
+ # the old process running.
+ oldpid="%{_localstatedir}/run/puppet/puppetd.pid"
+ newpid="%{_localstatedir}/run/puppet/agent.pid"
+ if [ -s "$oldpid" -a ! -s "$newpid" ]; then
+ (kill $(< "$oldpid") && rm -f "$oldpid" && \
+ /sbin/service puppet start) >/dev/null 2>&1 || :
+ fi
+fi
%post server
/sbin/chkconfig --add puppetmaster || :
+if [ "$1" -ge 1 ]; then
+ # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving
+ # the old process running.
+ oldpid="%{_localstatedir}/run/puppet/puppetmasterd.pid"
+ newpid="%{_localstatedir}/run/puppet/master.pid"
+ if [ -s "$oldpid" -a ! -s "$newpid" ]; then
+ (kill $(< "$oldpid") && rm -f "$oldpid" && \
+ /sbin/service puppetmaster start) >/dev/null 2>&1 || :
+ fi
+fi
%preun
if [ "$1" = 0 ] ; then
@@ -228,6 +248,7 @@ rm -rf %{buildroot}
- Ensure %%pre exits cleanly
- Fix License tag, puppet is now GPLv2 only
- Create and own /usr/share/puppet/modules (#615432)
+- Properly restart puppet agent/master daemons on upgrades from 0.25.x
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild