From 6e7f2a531d1b3e2cdd517de0d477d2cb143f5ae1 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Wed, 16 Mar 2011 10:36:41 -0400 Subject: [PATCH] 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 file changed, 21 insertions(+) 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 - 0.25.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild