diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-08-07 03:02:51 +0000 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-08-11 15:59:58 -0500 |
commit | f2f7aa8a83b244a509de30c2ef58766bb31c63f3 (patch) | |
tree | c0c0382e06b8a37c58d4262d1e3a492ed7d1225a /debian/bcfg2.init | |
parent | 869537f3b703119ceb397b85ca38b4dff99b8d6b (diff) | |
download | bcfg2-f2f7aa8a83b244a509de30c2ef58766bb31c63f3.tar.gz bcfg2-f2f7aa8a83b244a509de30c2ef58766bb31c63f3.tar.bz2 bcfg2-f2f7aa8a83b244a509de30c2ef58766bb31c63f3.zip |
debian: Merge in changes from Arto Jantunen
bcfg2.init: Remove agent mode (no longer exists)
POSIX.py: Fix hardcoded errno value
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6005 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'debian/bcfg2.init')
-rw-r--r-- | debian/bcfg2.init | 76 |
1 files changed, 10 insertions, 66 deletions
diff --git a/debian/bcfg2.init b/debian/bcfg2.init index 76adf0ad4..add840c90 100644 --- a/debian/bcfg2.init +++ b/debian/bcfg2.init @@ -38,26 +38,21 @@ test -f "/etc/default/bcfg2" && . /etc/default/bcfg2 [ "$BCFG2_AGENT" -eq 0 -a "$BCFG2_INIT" -eq 0 ] && exit 0 # Exit if bcfg2 doesn't exist and is not executable -test -x $BCFG2 || exit 5 +test -x $BCFG2 || exit 0 + +if [ "$BCFG2_AGENT" != 0 ]; then + echo "Bcfg2 no longer supports agent mode, please update your configuration!" + exit 1 +fi -# Agent mode daemon capability -PIDFILE=/var/run/bcfg2-agent.pid # Internal variables BINARY=$(basename $BCFG2) -AGENT_EXTRA_OPTS="-A -i ${PIDFILE}" - # Include lsb functions . /lib/lsb/init-functions start () { echo -n "Running configuration management client: " - if [ "$BCFG2_AGENT" -eq 1 ] - then - start_daemon ${BCFG2} ${AGENT_EXTRA_OPTS} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_AGENT} - STATUS=$? - fi - if [ "$BCFG2_INIT" -eq 1 ]; then ${BCFG2} ${BCFG2_OPTIONS} ${BCFG2_OPTIONS_INIT} STATUS=$? @@ -66,75 +61,24 @@ start () { if [ "$STATUS" -eq 0 ] then log_success_msg "bcfg2" - if [ "$BCFG2_AGENT" -eq 1 ]; then - test -d /var/lock/subsys && touch /var/lock/subsys/bcfg2-agent - fi else log_failure_msg "bcfg2" fi return $STATUS } -status () { - if [ "$BCFG2_AGENT" -eq 1 ] - then - PID=$(pidof -x $BINARY) - if [ -n "$PID" ] ; then - log_success_msg "$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 - else - return 0 - fi -} - -stop () { - if [ "$BCFG2_AGENT" -eq 1 ] - then - echo -n "Stopping configuration management client daemon: " - killproc -p $PIDFILE ${BINARY} - STATUS=$? - if [ "$STATUS" -eq 0 ] - then - log_success_msg "bcfg2" - if [ "$BCFG2_AGENT" -eq 1 ]; then - test -d /var/lock/subsys && rm -f /var/lock/subsys/bcfg2-agent - fi - else - log_failure_msg "bcfg2" - fi - return $STATUS - else - return 0 - fi -} - case "$1" in start) start ;; stop) - stop - ;; - status) - status + exit 0 ;; - restart|reload|force-reload) - if [ "$BCFG2_AGENT" -eq 1 ] - then - stop - sleep 5 - start - fi + restart|force-reload) + start ;; *) - echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" + echo "Usage: $0 {start|stop|restart|force-reload}" exit 1 esac |