diff options
-rw-r--r-- | debian/bcfg2-server.default | 13 | ||||
-rw-r--r-- | debian/bcfg2-server.init | 11 | ||||
-rw-r--r-- | debian/bcfg2-server.install | 1 | ||||
-rw-r--r-- | debian/bcfg2-server.postinst | 4 | ||||
-rw-r--r-- | debian/bcfg2-server.postrm | 11 | ||||
-rwxr-xr-x | debian/rules | 2 |
6 files changed, 41 insertions, 1 deletions
diff --git a/debian/bcfg2-server.default b/debian/bcfg2-server.default new file mode 100644 index 000000000..2e8ccabd0 --- /dev/null +++ b/debian/bcfg2-server.default @@ -0,0 +1,13 @@ +# Configuration options for bcfg2 server + +# BCFG2_SERVER_OPTIONS: +# Set the default options for Bcfg2 Server on startup +# Default: "" +#BCFG2_SERVER_OPTIONS="" + +# BCFG2_SERVER_ENABLED: +# Should Bcfg2 Server be run automatically by system scripts +# +# Uncomment the following line to enable any of the below selections +# Default: 0 (disable) +#BCFG2_SERVER_ENABLED=1 diff --git a/debian/bcfg2-server.init b/debian/bcfg2-server.init index d8ed2e908..7f760bd75 100644 --- a/debian/bcfg2-server.init +++ b/debian/bcfg2-server.init @@ -20,6 +20,15 @@ DAEMON=/usr/sbin/bcfg2-server PIDFILE=/var/run/bcfg2-server.pid PARAMS="-D $PIDFILE" +# Disabled per default +BCFG2_SERVER_OPTIONS="" +BCFG2_SERVER_ENABLED=0 + +# Include default startup configuration if exists +test -f "/etc/default/bcfg2-server" && . /etc/default/bcfg2-server + +[ "$BCFG2_SERVER_ENABLED" -eq 0 ] && exit 0 + # Exit if $DAEMON doesn't exist and is not executable test -x $DAEMON || exit 5 @@ -31,7 +40,7 @@ BINARY=$(basename $DAEMON) start () { echo -n "Starting Configuration Management Server: " - start_daemon ${DAEMON} ${PARAMS} + start_daemon ${DAEMON} ${PARAMS} ${BCFG2_SERVER_OPTIONS} STATUS=$? if [ "$STATUS" = 0 ] then diff --git a/debian/bcfg2-server.install b/debian/bcfg2-server.install index 6b325dd5e..859806fa0 100644 --- a/debian/bcfg2-server.install +++ b/debian/bcfg2-server.install @@ -1,3 +1,4 @@ +debian/bcfg2-server.default usr/share/bcfg2 debian/tmp/usr/bin/bcfg2-* usr/sbin debian/tmp/usr/lib/python*/*-packages/Bcfg2/Server/* debian/tmp/usr/share/bcfg2/* diff --git a/debian/bcfg2-server.postinst b/debian/bcfg2-server.postinst index c975103d9..260a821d0 100644 --- a/debian/bcfg2-server.postinst +++ b/debian/bcfg2-server.postinst @@ -19,6 +19,10 @@ set -e case "$1" in configure) + ucf /usr/share/bcfg2/bcfg2-server.default /etc/default/bcfg2-server + if [ -x /usr/bin/ucfr ] ; then + ucfr bcfg2 /etc/default/bcfg2-server + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/bcfg2-server.postrm b/debian/bcfg2-server.postrm index 1eb191fd7..8a99ba03c 100644 --- a/debian/bcfg2-server.postrm +++ b/debian/bcfg2-server.postrm @@ -19,6 +19,17 @@ set -e case "$1" in purge) + for i in /etc/default/bcfg2-server; do + rm -f $i + + if which ucf >/dev/null; then + ucf --purge $i + fi + if which ucfr >/dev/null; then + ucfr --purge bcfg2 $i + fi + + done ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) diff --git a/debian/rules b/debian/rules index f7defaf74..2e8cb547f 100755 --- a/debian/rules +++ b/debian/rules @@ -5,5 +5,7 @@ override_dh_installinit: # Install bcfg2 initscript without staring it on postinst dh_installinit -p bcfg2 --no-start + # Install bcfg2-server initscript without staring it on postinst + dh_installinit -p bcfg2-server --no-start # Install everything else normally dh_installinit -N bcfg2 |