[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. puppet-0.24.5-rc3-1476-g9ec14fc

Stig Sandbeck Mathisen ssm at fnord.no
Thu Dec 24 12:34:59 UTC 2009


The following commit has been merged in the master branch:
commit 9ec14fc2f0ce8b962a405a0d81b8f5c487036119
Author: Stig Sandbeck Mathisen <ssm at fnord.no>
Date:   Thu Dec 24 13:35:02 2009 +0100

    debian/{puppet,puppetmaster}.init: Add status argument, fix pid file locations (Closes: #545975)

diff --git a/debian/changelog b/debian/changelog
index fb623a2..2fd5a9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+puppet (0.25.1-4) UNRELEASED; urgency=low
+
+  * debian/{puppet,puppetmaster}.init: Add status argument, fix pid file
+    locations (Closes: #545975)
+
+ -- Stig Sandbeck Mathisen <ssm at debian.org>  Thu, 24 Dec 2009 13:31:32 +0100
+
 puppet (0.25.1-3) unstable; urgency=low
 
   [ Nigel Kersten ]
diff --git a/debian/puppet.init b/debian/puppet.init
index 62b07b0..1adf664 100644
--- a/debian/puppet.init
+++ b/debian/puppet.init
@@ -13,7 +13,7 @@ DAEMON=/usr/sbin/puppetd
 DAEMON_OPTS=""
 NAME=puppetd
 DESC="puppet configuration management tool"
-PIDFILE="/var/run/${NAME}.pid"
+PIDFILE="/var/run/puppet/${NAME}.pid"
 
 test -x $DAEMON || exit 0
 
@@ -47,6 +47,10 @@ stop_puppet() {
 	start-stop-daemon --stop --quiet --pidfile $PIDFILE
 }
 
+status_puppet() {
+	status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}"
+}
+
 case "$1" in
     start)
 	log_begin_msg "Starting $DESC"
@@ -63,6 +67,9 @@ case "$1" in
     	reload_puppet
     	log_end_msg 0
     	;;
+    status)
+	status_puppet
+	;;
     restart|force-reload)
 	log_begin_msg "Restarting $DESC"
 	stop_puppet
diff --git a/debian/puppetmaster.init b/debian/puppetmaster.init
index f4fd47c..117205c 100644
--- a/debian/puppetmaster.init
+++ b/debian/puppetmaster.init
@@ -41,13 +41,13 @@ start_puppetmaster() {
 	    NUMSTART=0
 	    STARTPORT=$PORT
 	    while [ $NUMSTART -lt $PUPPETMASTERS ]; do 
-		start-stop-daemon --start --quiet --pidfile=/var/run/${NAME}-${STARTPORT}.pid \
-		    --startas $DAEMON -- $DAEMON_OPTS --masterport=$STARTPORT --pidfile=/var/run/${NAME}-${STARTPORT}.pid
+		start-stop-daemon --start --quiet --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid \
+		    --startas $DAEMON -- $DAEMON_OPTS --masterport=$STARTPORT --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid
 		STARTPORT=$(($STARTPORT + 1))
 		NUMSTART=$(($NUMSTART + 1))
 	    done
 	else
-	    start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
+	    start-stop-daemon --start --quiet --pidfile /var/run/puppet/${NAME}.pid \
 		--startas $DAEMON -- $DAEMON_OPTS --masterport=$PORT
 	fi
     else
@@ -62,16 +62,38 @@ stop_puppetmaster() {
 	NUMSTART=0
 	STOPPORT=$PORT
 	while [ $NUMSTART -lt $PUPPETMASTERS ]; do 
-	    start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}-${STOPPORT}.pid
-	    rm /var/run/${NAME}-${STOPPORT}.pid
+	    start-stop-daemon --stop --quiet --pidfile /var/run/puppet/${NAME}-${STOPPORT}.pid
+	    rm -f /var/run/puppet/${NAME}-${STOPPORT}.pid
 	    STOPPORT=$(($STOPPORT + 1))
 	    NUMSTART=$(($NUMSTART + 1))
 	done
     else
-	start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid
+	start-stop-daemon --stop --quiet --pidfile /var/run/puppet/${NAME}.pid
     fi
 }
 
+status_puppetmaster() {
+    if is_true "$START" ; then
+	if [ "$SERVERTYPE" = "mongrel" ]
+	then
+	    NUMSTART=0
+	    STARTPORT=$PORT
+	    while [ $NUMSTART -lt $PUPPETMASTERS ]; do 
+		status_of_proc -p "/var/run/puppet/${NAME}-${STARTPORT}.pid" \
+                    "${DAEMON}" "${NAME}-${STARTPORT}"
+		STARTPORT=$(($STARTPORT + 1))
+		NUMSTART=$(($NUMSTART + 1))
+	    done
+	else
+            status_of_proc -p "/var/run/puppet/${NAME}.pid" "${DAEMON}" "${NAME}"
+	fi
+    else
+	echo ""
+	echo "puppetmaster not configured to start"
+    fi
+}
+
+
 case "$1" in
     start)
 	log_begin_msg "Starting $DESC"
@@ -86,6 +108,9 @@ case "$1" in
     reload)
   	# Do nothing, as Puppetmaster rechecks its config automatically
         ;;
+    status)
+	    status_puppetmaster
+        ;;
     restart|force-reload)
 	log_begin_msg "Restarting $DESC"
 	stop_puppetmaster

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list