[puppet] Properly restart puppet agent/master daemons on upgrades from 0.25.x

Todd Zullinger tmz at fedoraproject.org
Fri Mar 18 15:20:22 UTC 2011


commit 6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1
Author: Todd Zullinger <tmz at pobox.com>
Date:   Wed Mar 16 10:36:41 2011 -0400

    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.

 puppet.spec |   21 +++++++++++++++++++++
 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 at lists.fedoraproject.org> - 0.25.5-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild


More information about the scm-commits mailing list