[puppet] Ensure the old agent binary gets stopped since the init script doesn't reference it (BZ##1024538)

Sam Kottler skottler at fedoraproject.org
Tue Nov 5 21:32:38 UTC 2013


commit bfd9d587412279f83d779ec5d0038db0a9903b25
Author: Sam Kottler <shk at redhat.com>
Date:   Tue Nov 5 16:32:41 2013 -0500

    Ensure the old agent binary gets stopped since the init script doesn't reference it (BZ##1024538)

 puppet.spec |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/puppet.spec b/puppet.spec
index b85755e..eb53844 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -301,6 +301,17 @@ exit 0
 %if 0%{?_with_systemd}
 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 %else
+# If there's a running puppet agent, restart it during upgrade. Fixes
+# BZ #1024538.
+if [ "$1" -ge 1 ]; then
+  pid="%{_localstatedir}/run/puppet/agent.pid"
+  if [ -e "$pid" ]; then
+    if ps aux | grep `cat "$pid"` | grep -v grep | awk '{ print $12 }' | grep -q sbin; then
+      (kill $(< "$pid") && rm -f "$pid" && \
+        /sbin/service puppet start) >/dev/null 2>&1 || :
+    fi
+  fi
+fi
 /sbin/chkconfig --add puppet || :
 %endif
 


More information about the scm-commits mailing list