[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.25.4-2-11-g351fd46

Micah Anderson micah at riseup.net
Thu Apr 1 05:11:48 UTC 2010


The following commit has been merged in the master branch:
commit 351fd46a4419a0d1914fceb66954159e2c2c75f9
Author: Micah Anderson <micah at riseup.net>
Date:   Thu Apr 1 00:49:35 2010 -0400

    setup an initscript for puppetqd and the associated defaults values

diff --git a/debian/changelog b/debian/changelog
index c080fd5..525238b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,7 +15,8 @@ puppet (0.25.4-3) UNRELEASED; urgency=low
     puppetmaster is already stopped, Thanks Mathias Gug (Closes: #574677)
   * Add Suggests: stompserver/libstomp-ruby1.8 - needed for puppetqd 
   * Add README.queueing to puppetmaster package which describes puppetqd
-
+  * Add /etc/init.d/puppetqd and defaults in /etc/defaults/puppetmaster
+  
  -- Micah Anderson <micah at debian.org>  Tue, 16 Mar 2010 12:27:07 -0400
 
 puppet (0.25.4-2) unstable; urgency=low
diff --git a/debian/puppetmaster.default b/debian/puppetmaster.default
index ea4df06..dab64f7 100644
--- a/debian/puppetmaster.default
+++ b/debian/puppetmaster.default
@@ -34,3 +34,28 @@ PUPPETMASTERS=1
 # port 8140 and change the below number to something else, such as
 # 18140.
 PORT=8140
+
+# Should puppetqd (the storeconfigs queuing broker) be started? 
+#  This can take some load off of the puppetmaster by queuing the
+#  storeconfig updates to the database with puppetqd. You need
+#  to have the 'stompserver' package installed and running, and
+#  the following configured in your puppet.conf:
+#
+#  [main]
+#  queue_type = stomp
+#  queue_source = stomp://localhost:61613
+#  dbadapter = (sqlite3|mysql|postgresql)
+#  dbserver=localhost
+#  dbname=puppet
+#  dbuser=puppet
+#  dbpassword=xxxx
+#  dblocation = /var/lib/puppet/storeconfigs.sqlite <-- only if using sqlite
+#  [puppetmasterd]
+#  async_storeconfigs = true
+#
+#  See: http://reductivelabs.com/trac/puppet/wiki/UsingStoredConfiguration
+#
+#  Once you have the proper puppet.conf, and stompserver, you can enable
+#  the following:
+PUPPETQD=no
+PUPPETQD_OPTS=""
diff --git a/debian/puppetmaster.puppetqd.init b/debian/puppetmaster.puppetqd.init
new file mode 100644
index 0000000..8bcf118
--- /dev/null
+++ b/debian/puppetmaster.puppetqd.init
@@ -0,0 +1,82 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: puppetqd
+# Required-Start:    $network $named $remote_fs $syslog
+# Required-Stop:     $network $named $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+### END INIT INFO                 
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/puppetqd
+DAEMON_OPTS=""
+NAME=puppetqd
+DESC="puppetmaster queue broker management daemon"
+
+test -x $DAEMON || exit 0
+
+[ -r /etc/default/puppetmaster ] && . /etc/default/puppetmaster
+
+. /lib/lsb/init-functions
+
+if [ ! -d /var/run/puppet ]; then
+	mkdir -p /var/run/puppet
+fi
+
+chown puppet:puppet /var/run/puppet
+
+is_true() {
+    if [ "x$1" = "xtrue" -o "x$1" = "xyes" -o "x$1" = "x0" ] ; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+start_puppetqd() {
+    if is_true "$PUPPETQD" ; then
+	start-stop-daemon --start --quiet --pidfile=/var/run/puppet/puppetqd.pid \
+	    --startas $DAEMON -- $DAEMON_OPTS
+    fi
+}
+
+stop_puppetqd() {
+        start-stop-daemon --stop --quiet oknodo --pidfile /var/run/puppet/puppetqd.pid
+}
+
+status_puppetqd() {
+    if is_true "PUPPETQD" ; then
+        status_of_proc -p "/var/run/puppet/puppetqd.pid" "${DAEMON}" "${NAME}"
+    else
+	echo ""
+	echo "puppetqd not configured to start"
+    fi
+}
+
+
+case "$1" in
+    start)
+	log_begin_msg "Starting $DESC"
+	start_puppetqd
+	log_end_msg $?
+	;;
+    stop)
+	log_begin_msg "Stopping $DESC"
+	stop_puppetqd
+	log_end_msg $?
+	;;
+    status)
+	    status_puppetqd
+        ;;
+    reload|restart|force-reload)
+	log_begin_msg "Restarting $DESC"
+	stop_puppetqd
+	sleep 1
+	start_puppetqd
+	log_end_msg $?
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
diff --git a/debian/rules b/debian/rules
index b787f26..a9edcf6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -97,6 +97,7 @@ binary-indep: build install
 	dh_installlogcheck
 	dh_installman
 	dh_installinit -ppuppetmaster
+	dh_installinit --name=puppetqd
 	dh_installinit -ppuppet --error-handler=true -- defaults 21 
 	dh_installlogrotate -i
 	dh_compress -i

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list