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.
epel9
Todd Zullinger 14 years ago
parent 9bf6b15a1e
commit 6e7f2a531d

@ -193,9 +193,29 @@ exit 0
%post %post
/sbin/chkconfig --add puppet || : /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 %post server
/sbin/chkconfig --add puppetmaster || : /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 %preun
if [ "$1" = 0 ] ; then if [ "$1" = 0 ] ; then
@ -228,6 +248,7 @@ rm -rf %{buildroot}
- Ensure %%pre exits cleanly - Ensure %%pre exits cleanly
- Fix License tag, puppet is now GPLv2 only - Fix License tag, puppet is now GPLv2 only
- Create and own /usr/share/puppet/modules (#615432) - 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 * 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 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

Loading…
Cancel
Save