From 5abfc3d19f63d5d165b4de194327a904b6d9f708 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Sun, 9 Jun 2013 16:18:45 -0500 Subject: debian: Add python-mock build dependency Signed-off-by: Sol Jerome --- debian/control | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/control b/debian/control index 20cef93c8..285b1389a 100644 --- a/debian/control +++ b/debian/control @@ -14,6 +14,7 @@ Build-Depends: debhelper (>= 7.0.50~), python-pyinotify, python-m2crypto, python-doc, + python-mock, python-mock-doc Build-Depends-Indep: python-support (>= 0.5.3) Standards-Version: 3.8.0.0 -- cgit v1.2.3-1-g7c22 From 015d87d0873fb58c84204210407d4ea17582cf7a Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Sun, 9 Jun 2013 16:26:21 -0500 Subject: debian: Add python-genshi build dependency Signed-off-by: Sol Jerome --- debian/control | 1 + 1 file changed, 1 insertion(+) (limited to 'debian') diff --git a/debian/control b/debian/control index 285b1389a..7b27b27ed 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,7 @@ Build-Depends: debhelper (>= 7.0.50~), python-daemon, python-cherrypy, python-gamin, + python-genshi, python-pyinotify, python-m2crypto, python-doc, -- cgit v1.2.3-1-g7c22 From 2907481679db553bedfe076cb9dbcb83d011695b Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 10 Jun 2013 19:44:10 -0500 Subject: debian: Update rules to use dh_python2 Signed-off-by: Sol Jerome --- debian/rules | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/debian/rules b/debian/rules index 5694e4e37..18d55b8f4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,12 @@ #!/usr/bin/make -f +# Lucid does not have dh_python2, but we would like to be able to use +# this rules file to build on lucid as well. +WITH_PYTHON2 = $(shell test -f /usr/bin/dh_python2 && echo "--with python2") +WITH_SPHINXDOC = $(shell test -f /usr/bin/dh_sphinxdoc && echo "--with sphinxdoc") + %: - dh $@ --with python-support,sphinxdoc + dh $@ ${WITH_PYTHON2} ${WITH_SPHINXDOC} override_dh_installinit: # Install bcfg2 initscript without starting it on postinst -- cgit v1.2.3-1-g7c22 From ad68d730d9f035ae607de872bc3b0bddc1d8c2f6 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 13 Jun 2013 17:23:37 +0200 Subject: add bcfg2-report-collector init script to debian package --- debian/bcfg2-report-collector.init | 111 ------------------------ debian/bcfg2-server.bcfg2-report-collector.init | 111 ++++++++++++++++++++++++ debian/rules | 2 + 3 files changed, 113 insertions(+), 111 deletions(-) delete mode 100755 debian/bcfg2-report-collector.init create mode 100755 debian/bcfg2-server.bcfg2-report-collector.init (limited to 'debian') diff --git a/debian/bcfg2-report-collector.init b/debian/bcfg2-report-collector.init deleted file mode 100755 index df7b751cb..000000000 --- a/debian/bcfg2-report-collector.init +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh -# -# bcfg-report-collector - Bcfg2 reporting collector daemon -# -# chkconfig: 2345 19 81 -# description: bcfg2 server for reporting data -# -### BEGIN INIT INFO -# Provides: bcfg2-report-collector -# Required-Start: $network $remote_fs $named -# Required-Stop: $network $remote_fs $named -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Configuration management Server -# Description: Bcfg2 is a configuration management system that builds -# installs configuration files served by bcfg2-server -### END INIT INFO - -# Include lsb functions -. /lib/lsb/init-functions - -# Commonly used stuff -DAEMON=/usr/sbin/bcfg2-report-collector -PIDFILE=/var/run/bcfg2-server/bcfg2-report-collector.pid -PARAMS="-D $PIDFILE" - -# Include default startup configuration if exists -test -f "/etc/default/bcfg2-server" && . /etc/default/bcfg2-server - -# Exit if $DAEMON doesn't exist and is not executable -test -x $DAEMON || exit 5 - -# Internal variables -BINARY=$(basename $DAEMON) -RETVAL=0 - -start () { - echo -n "Starting Configuration Report Collector: " - start_daemon ${DAEMON} ${PARAMS} ${BCFG2_REPORT_OPTIONS} - STATUS=$? - if [ "$STATUS" = 0 ] - then - log_success_msg "bcfg2-report-collector" - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-report-collector - else - log_failure_msg "bcfg2-report-collector" - fi - return $STATUS -} - -stop () { - echo -n "Stopping Configuration Report Collector: " - if [ -f $PIDFILE ]; then - killproc -p $PIDFILE ${BINARY} - else - killproc ${BINARY} - fi - STATUS=$? - if [ "$STATUS" = 0 ]; then - log_success_msg "bcfg2-report-collector" - test -e /var/lock/subsys/bcfg2-report-collector && rm /var/lock/subsys/bcfg2-report-collector - else - log_failure_msg "bcfg2-report-collector" - fi - return $STATUS -} - -status () { - PID=$(pidofproc -p "$PIDFILE" $BINARY) - if [ -n "$PID" ]; then - echo "$BINARY (pid $PID) is running..." - return 0 - fi - - if [ -f $PIDFILE ]; then - if [ -n "$PID" ]; then - log_failure_msg "$BINARY dead but pid file exists..." - return 1 - fi - fi - - log_failure_msg "$BINARY is not running" - return 3 -} - -case "$1" in - start) - start - RETVAL=$? - ;; - stop) - stop - RETVAL=$? - ;; - status) - status - RETVAL=$? - ;; - restart|reload|force-reload) - stop - sleep 5 - start - RETVAL=$? - ;; - *) - log_success_msg "Usage: $0 {start|stop|status|reload|restart|force-reload}" - RETVAL=1 - ;; -esac - -exit $RETVAL diff --git a/debian/bcfg2-server.bcfg2-report-collector.init b/debian/bcfg2-server.bcfg2-report-collector.init new file mode 100755 index 000000000..df7b751cb --- /dev/null +++ b/debian/bcfg2-server.bcfg2-report-collector.init @@ -0,0 +1,111 @@ +#!/bin/sh +# +# bcfg-report-collector - Bcfg2 reporting collector daemon +# +# chkconfig: 2345 19 81 +# description: bcfg2 server for reporting data +# +### BEGIN INIT INFO +# Provides: bcfg2-report-collector +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Configuration management Server +# Description: Bcfg2 is a configuration management system that builds +# installs configuration files served by bcfg2-server +### END INIT INFO + +# Include lsb functions +. /lib/lsb/init-functions + +# Commonly used stuff +DAEMON=/usr/sbin/bcfg2-report-collector +PIDFILE=/var/run/bcfg2-server/bcfg2-report-collector.pid +PARAMS="-D $PIDFILE" + +# Include default startup configuration if exists +test -f "/etc/default/bcfg2-server" && . /etc/default/bcfg2-server + +# Exit if $DAEMON doesn't exist and is not executable +test -x $DAEMON || exit 5 + +# Internal variables +BINARY=$(basename $DAEMON) +RETVAL=0 + +start () { + echo -n "Starting Configuration Report Collector: " + start_daemon ${DAEMON} ${PARAMS} ${BCFG2_REPORT_OPTIONS} + STATUS=$? + if [ "$STATUS" = 0 ] + then + log_success_msg "bcfg2-report-collector" + test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-report-collector + else + log_failure_msg "bcfg2-report-collector" + fi + return $STATUS +} + +stop () { + echo -n "Stopping Configuration Report Collector: " + if [ -f $PIDFILE ]; then + killproc -p $PIDFILE ${BINARY} + else + killproc ${BINARY} + fi + STATUS=$? + if [ "$STATUS" = 0 ]; then + log_success_msg "bcfg2-report-collector" + test -e /var/lock/subsys/bcfg2-report-collector && rm /var/lock/subsys/bcfg2-report-collector + else + log_failure_msg "bcfg2-report-collector" + fi + return $STATUS +} + +status () { + PID=$(pidofproc -p "$PIDFILE" $BINARY) + if [ -n "$PID" ]; then + echo "$BINARY (pid $PID) is running..." + return 0 + fi + + if [ -f $PIDFILE ]; then + if [ -n "$PID" ]; then + log_failure_msg "$BINARY dead but pid file exists..." + return 1 + fi + fi + + log_failure_msg "$BINARY is not running" + return 3 +} + +case "$1" in + start) + start + RETVAL=$? + ;; + stop) + stop + RETVAL=$? + ;; + status) + status + RETVAL=$? + ;; + restart|reload|force-reload) + stop + sleep 5 + start + RETVAL=$? + ;; + *) + log_success_msg "Usage: $0 {start|stop|status|reload|restart|force-reload}" + RETVAL=1 + ;; +esac + +exit $RETVAL diff --git a/debian/rules b/debian/rules index 18d55b8f4..eaf80a4d7 100755 --- a/debian/rules +++ b/debian/rules @@ -13,6 +13,8 @@ override_dh_installinit: dh_installinit --package=bcfg2 --no-start # Install bcfg2-server initscript without starting it on postinst dh_installinit --package=bcfg2-server --no-start + # Install bcfg2-report-collector initscript without starting it on postinst + dh_installinit --package=bcfg2-server --name=bcfg2-report-collector --no-start override_dh_auto_build: dh_auto_build -- cgit v1.2.3-1-g7c22