[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1456-g2f0b1e5

Todd Zullinger tmz at pobox.com
Tue Oct 27 17:06:14 UTC 2009


The following commit has been merged in the upstream branch:
commit 9dff7167b71f392ec4706c5e220f52c9e1694d0a
Author: Todd Zullinger <tmz at pobox.com>
Date:   Sun Oct 25 11:00:42 2009 -0400

    conf/redhat/*.init: Use -p option to killproc
    
    If a puppetd run was started manually and 'service puppet stop' was run
    the killproc function used would kill the manually started puppetd.  On
    Fedora and newer RHEL (>= 5) we now use the -p option to prevent this.
    
    This fixes #2751 (Red Hat initscripts kill an independently started
    puppetd/puppetmasterd)
    
    Signed-off-by: Todd Zullinger <tmz at pobox.com>

diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index a5ac08d..0c98383 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -27,6 +27,9 @@ PUPPET_OPTS=""
 [ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
 [ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --masterport=${PUPPET_PORT}"
 
+# Determine if we can use the -p option to killproc.  RHEL < 5 can't.
+killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
+
 # Figure out if the system just booted. Let's assume
 # boot doesn't take longer than 5 minutes
 ## Not used for now
@@ -43,7 +46,7 @@ start() {
 
 stop() {
     echo -n $"Stopping puppet: "
-    killproc $puppetd
+    killproc $killopts $puppetd
     RETVAL=$?
     echo
     [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
@@ -51,7 +54,7 @@ stop() {
 
 reload() {
     echo -n $"Restarting puppet: "
-    killproc $puppetd -HUP
+    killproc $killopts $puppetd -HUP
     RETVAL=$?
     echo
     return $RETVAL
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 4bc44b9..5505058 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -71,8 +71,9 @@ stop() {
             ret=$?; [ $ret != 0 ] && RETVAL=$ret
         done
     else
-       killproc $PUPPETMASTER
-       RETVAL=$?
+        killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
+        killproc $killopts $PUPPETMASTER
+        RETVAL=$?
     fi
     echo
     [ $RETVAL -eq 0 ] && rm -f "$lockfile"

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list