diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/buildsys/2.3/bcfg2-server.init | 27 | ||||
-rw-r--r-- | debian/buildsys/2.3/bcfg2.init | 47 | ||||
-rw-r--r-- | debian/buildsys/common/bcfg2-server.init | 19 | ||||
-rw-r--r-- | debian/buildsys/common/bcfg2.init | 11 | ||||
-rwxr-xr-x | debian/rules | 1 |
5 files changed, 63 insertions, 42 deletions
diff --git a/debian/buildsys/2.3/bcfg2-server.init b/debian/buildsys/2.3/bcfg2-server.init index 8025b72cc..fb4e0cbe5 100644 --- a/debian/buildsys/2.3/bcfg2-server.init +++ b/debian/buildsys/2.3/bcfg2-server.init @@ -5,21 +5,34 @@ # chkconfig: 2345 19 81 # description: bcfg2 server for configuration requests # +### BEGIN INIT INFO +# Provides: bcfg2-server +# Required-Start: $network +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: S 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 PIDFILE=/var/tmp/bcfg2-server.pid +msg=echo +fail=echo + case "$1" in start) - echo -n "Starting bcfg2-server: " + $msg -n "Starting bcfg2-server: " if [ -f "/etc/debian_version" ] ; then /sbin/start-stop-daemon --pidfile "${PIDFILE}" --make-pidfile -b -S --startas /usr/sbin/bcfg2-server else /usr/sbin/bcfg2-server -D "${PIDFILE}" fi - echo "bcfg2-server" + $msg "bcfg2-server" ;; stop) - echo -n "Stopping bcfg2-server: " + $msg -n "Stopping bcfg2-server: " if [ -f "/etc/debian_version" ] ; then /sbin/start-stop-daemon -p "${PIDFILE}" -K /usr/sbin/bcfg2-server else @@ -27,17 +40,13 @@ case "$1" in fi echo done ;; - restart) + restart|force-reload|reload) $0 stop sleep 5 $0 start ;; - force-reload) - $0 stop - $0 start - ;; *) - echo "Usage: bcfg2-server {start|stop|restart|force-reload}" + ${msg} "Usage: $0 {start|stop|status|reload|restart|force-reload}" exit 1 esac diff --git a/debian/buildsys/2.3/bcfg2.init b/debian/buildsys/2.3/bcfg2.init index 9dd6c87a1..dfa6f014e 100644 --- a/debian/buildsys/2.3/bcfg2.init +++ b/debian/buildsys/2.3/bcfg2.init @@ -4,7 +4,25 @@ # # chkconfig: 2345 19 81 # description: bcfg2 client for configuration requests -# +# +### BEGIN INIT INFO +# Provides: bcfg2 +# Required-Start: $network $named +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: S 0 1 6 +# Short-Description: Configuration management client +# Description: Bcfg2 is a configuration management system that builds +# installs configuration files served by bcfg2-server +# This is a client that installs the server provided +# Configuration. +### END INIT INFO + +# This might need some better logic +BCFG2=/usr/sbin/bcfg2 + +# Set default options +# You can set script specific options with BCFG2_OPTIONS_INIT BCFG2_OPTIONS="-q" # Disabled per default @@ -16,29 +34,24 @@ test -f "/etc/default/bcfg2" && . /etc/default/bcfg2 [ "$BCFG2_ENABLED" == "0" -o "$BCFG2_INIT" == 0 ] && exit 0 +# Exit if bcfg2 doesn't exist and is not executable +test -x $BCFG2 || exit 5 + case "$1" in start) - if test -e /etc/donttouchme; then - rm -f /etc/donttouchme - echo "bcfg2 does not need to run." - else - echo -n "Running bcfg: " - /usr/sbin/bcfg2 $BCFG2_OPTIONS $BCFG2_OPTIONS_INIT - echo "bcfg2" - fi - ;; - stop) - /bin/true + echo -n "Running configuration management client: " + ${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT} + echo "bcfg2" ;; - restart) - $0 stop - $0 start + status) + # Since we are always OK, always return OK as status + exit 0 ;; - force-reload) + restart|reload|stop|force-reload) true ;; *) - echo "Usage: bcfg2 {start|stop|restart}" + echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" exit 1 esac diff --git a/debian/buildsys/common/bcfg2-server.init b/debian/buildsys/common/bcfg2-server.init index 5a51056f2..512c80637 100644 --- a/debian/buildsys/common/bcfg2-server.init +++ b/debian/buildsys/common/bcfg2-server.init @@ -26,6 +26,9 @@ test -x $DAEMON || exit 5 # Include lsb functions . /lib/lsb/init-functions +msg=log_success_msg +fail=log_failure_msg + # Internal variables BINARY=$(basename $DAEMON) @@ -36,9 +39,9 @@ case "$1" in STATUS=$? if [ "$STATUS" = 0 ] then - log_success_msg "bcfg2-server" + ${msg} "bcfg2-server" else - log_failure_msg "bcfg2-server" + ${fail} "bcfg2-server" fi exit $STATUS ;; @@ -47,14 +50,14 @@ case "$1" in killproc ${BINARY} STATUS=$? if [ "$STATUS" = 0 ]; then - log_success_msg "bcfg2-server" + ${msg} "bcfg2-server" exit 0 else - log_failure_msg "bcfg2-server" + ${fail} "bcfg2-server" fi exit $STATUS ;; - force-reload|restart) + restart|force-reload|reload) $0 stop sleep 5 $0 start @@ -69,16 +72,16 @@ case "$1" in if [ -f $PIDFILE ]; then if [ -n "$PID" ]; then - echo "$BINARY dead but pid file exists..." + ${fail} "$BINARY dead but pid file exists..." exit 1 fi fi - echo "$BINARY is not running" + ${fail} "$BINARY is not running" exit 3 ;; *) - log_success_msg "Usage: bcfg2-server {start|stop|restart|force-reload}" + ${msg} "Usage: $0 {start|stop|status|reload|restart|force-reload}" exit 1 ;; esac diff --git a/debian/buildsys/common/bcfg2.init b/debian/buildsys/common/bcfg2.init index 8476c3718..ca6262afc 100644 --- a/debian/buildsys/common/bcfg2.init +++ b/debian/buildsys/common/bcfg2.init @@ -1,5 +1,4 @@ #!/bin/sh -# Start bcfg2 client on startup # # bcfg2 - bcfg2 configuration client # @@ -9,7 +8,7 @@ ### BEGIN INIT INFO # Provides: bcfg2 # Required-Start: $network $named -# Required-Stop: +# Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: Configuration management client @@ -54,19 +53,15 @@ case "$1" in fi exit $STATUS ;; - restart) - $0 stop - $0 start - ;; status) # Since we are always OK, always return OK as status exit 0 ;; - stop|force-reload) + restart|reload|stop|force-reload) true ;; *) - echo "Usage: $0 {start|stop|restart|force-reload|status}" + echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" exit 1 esac diff --git a/debian/rules b/debian/rules index d3a344100..94cc1035c 100755 --- a/debian/rules +++ b/debian/rules @@ -38,5 +38,6 @@ binary-install/bcfg2 :: dh_installinit -p$(cdbs_curpkg) -o --no-start binary-install/bcfg2-server :: + cd doc && make manual.html dh_installinit -p$(cdbs_curpkg) -o endif |