[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Markus Roberts Markus at reality.com
Wed Jul 14 10:37:53 UTC 2010


The following commit has been merged in the upstream branch:
commit 04228528d1f8e4d36e1643ac0cf51281b81ef9fb
Author: Todd Zullinger <tmz at pobox.com>
Date:   Tue Oct 27 01:03:33 2009 -0400

    conf/redhat: Consistently pass pidfile option to daemon, killproc, and status
    
    In Red Hat bug #531116 Ruben Kerkhof noted that we weren't using the
    --pidfile $pidfile option to daemon.  This caused 'service puppet start'
    to fail if puppet had already been started.  To be consistent, we now
    pass the pidfile option to daemon, killproc, and status when those
    functions provide such an option.  And we only test for the availability
    of the -p/--pidfile option in one place.

diff --git a/conf/redhat/client.init b/conf/redhat/client.init
index 04e0d27..f624d81 100644
--- a/conf/redhat/client.init
+++ b/conf/redhat/client.init
@@ -27,8 +27,12 @@ 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"
+# Determine if we can use the -p option to daemon, killproc, and status.
+# RHEL < 5 can't.
+if status | grep -q -- '-p' 2>/dev/null; then
+    daemonopts="--pidfile $pidfile"
+    pidopts="-p $pidfile"
+fi
 
 # Figure out if the system just booted. Let's assume
 # boot doesn't take longer than 5 minutes
@@ -37,7 +41,7 @@ killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
 
 start() {
     echo -n $"Starting puppet: "
-    daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
+    daemon $daemonopts $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
     RETVAL=$?
     echo
         [ $RETVAL = 0 ] && touch ${lockfile}
@@ -46,7 +50,7 @@ start() {
 
 stop() {
     echo -n $"Stopping puppet: "
-    killproc $killopts $puppetd
+    killproc $pidopts $puppetd
     RETVAL=$?
     echo
     [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
@@ -54,7 +58,7 @@ stop() {
 
 reload() {
     echo -n $"Restarting puppet: "
-    killproc $killopts $puppetd -HUP
+    killproc $pidopts $puppetd -HUP
     RETVAL=$?
     echo
     return $RETVAL
@@ -66,8 +70,7 @@ restart() {
 }
 
 rh_status() {
-    status | grep -q -- '-p' 2>/dev/null && statusopts="-p $pidfile"
-    status $statusopts $puppetd
+    status $pidopts $puppetd
     RETVAL=$?
     return $RETVAL
 }
diff --git a/conf/redhat/server.init b/conf/redhat/server.init
index 3d2897d..4d3a72c 100644
--- a/conf/redhat/server.init
+++ b/conf/redhat/server.init
@@ -33,6 +33,13 @@ fi
 PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
     ${PUPPETMASTER_EXTRA_OPTS}"
 
+# Determine if we can use the -p option to daemon, killproc, and status.
+# RHEL < 5 can't.
+if status | grep -q -- '-p' 2>/dev/null; then
+    daemonopts="--pidfile $pidfile"
+    pidopts="-p $pidfile"
+fi
+
 RETVAL=0
 
 prog=puppetmasterd
@@ -50,7 +57,7 @@ start() {
                 ret=$?; [ $ret != 0 ] && RETVAL=$ret
             done
         else
-            daemon $PUPPETMASTER $PUPPETMASTER_OPTS
+            daemon $daemonopts $PUPPETMASTER $PUPPETMASTER_OPTS
             RETVAL=$?
         fi
     else
@@ -72,8 +79,7 @@ stop() {
             ret=$?; [ $ret != 0 ] && RETVAL=$ret
         done
     else
-        killproc | grep -q -- '-p' 2>/dev/null && killopts="-p $pidfile"
-        killproc $killopts $PUPPETMASTER
+        killproc $pidopts $PUPPETMASTER
         RETVAL=$?
     fi
     echo
@@ -99,7 +105,7 @@ rh_status() {
             ret=$?; [ $ret != 0 ] && RETVAL=$ret
         done
     else
-        status $PUPPETMASTER
+        status $pidopts $PUPPETMASTER
         RETVAL=$?
     fi
     return $RETVAL

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list