From c647ffa0841a545d0a49e584213366c7fc064672 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Jan 2008 00:35:11 +0000 Subject: Update contributed scripts to use autoconf substitution for the paths to binaries, configuration files and local state files. --- contrib/debian/bbackupd | 38 ------------ contrib/debian/bbackupd.in | 46 +++++++++++++++ contrib/debian/bbstored | 38 ------------ contrib/debian/bbstored.in | 46 +++++++++++++++ contrib/redhat/bbackupd | 83 -------------------------- contrib/redhat/bbackupd.in | 83 ++++++++++++++++++++++++++ contrib/redhat/bbstored | 83 -------------------------- contrib/redhat/bbstored.in | 83 ++++++++++++++++++++++++++ contrib/solaris/bbackupd-smf-method.in | 2 +- contrib/solaris/bbstored-smf-method.in | 2 +- contrib/suse/bbackupd | 101 -------------------------------- contrib/suse/bbackupd.in | 103 ++++++++++++++++++++++++++++++++ contrib/suse/bbstored | 103 -------------------------------- contrib/suse/bbstored.in | 104 +++++++++++++++++++++++++++++++++ 14 files changed, 467 insertions(+), 448 deletions(-) delete mode 100644 contrib/debian/bbackupd create mode 100644 contrib/debian/bbackupd.in delete mode 100644 contrib/debian/bbstored create mode 100644 contrib/debian/bbstored.in delete mode 100644 contrib/redhat/bbackupd create mode 100644 contrib/redhat/bbackupd.in delete mode 100644 contrib/redhat/bbstored create mode 100644 contrib/redhat/bbstored.in delete mode 100644 contrib/suse/bbackupd create mode 100644 contrib/suse/bbackupd.in delete mode 100644 contrib/suse/bbstored create mode 100644 contrib/suse/bbstored.in (limited to 'contrib') diff --git a/contrib/debian/bbackupd b/contrib/debian/bbackupd deleted file mode 100644 index e6d5326c..00000000 --- a/contrib/debian/bbackupd +++ /dev/null @@ -1,38 +0,0 @@ -#! /bin/sh - -# Start and stop the Box Backup client daemon. - -test -x /usr/local/bin/bbackupd || exit 0 -test -f /etc/box/bbackupd.conf || exit 0 - -case $1 in - start) - echo -n "Starting Box Backup Client daemon: bbackupd" - start-stop-daemon --start --quiet --exec /usr/local/bin/bbackupd > /dev/null - echo "." - ;; - - stop) - echo -n "Stopping Box Backup Client daemon: bbackupd" - start-stop-daemon --stop --quiet --pidfile /var/run/bbackupd.pid --exec /usr/local/bin/bbackupd - echo "." - ;; - - reload|force-reload) - echo -n "Reloading the Box Backup Client daemon's configuration" - start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/bbackupd.pid --exec /usr/local/bin/bbackupd - echo "." - ;; - - restart) - echo -n "Restarting the Box Backup Client daemon: bbackupd" - start-stop-daemon --stop --quiet --pidfile /var/run/bbackupd.pid --exec /usr/local/bin/bbackupd - start-stop-daemon --start --quiet --exec /usr/local/bin/bbackupd > dev/null - echo "." - ;; - *) - echo "Usage: /etc/init.d/bbackupd {start|stop|reload|force-reload|restart}" - exit 1 -esac - -exit 0 diff --git a/contrib/debian/bbackupd.in b/contrib/debian/bbackupd.in new file mode 100644 index 00000000..78d4f4ee --- /dev/null +++ b/contrib/debian/bbackupd.in @@ -0,0 +1,46 @@ +#! /bin/sh + +# Start and stop the Box Backup client daemon. + +BBACKUPD=@bindir_expanded@/bbackupd +CONFIG=@sysconfdir_expanded@/box/bbackupd.conf +PIDFILE=@localstatedir_expanded@/bbackupd.pid + +test -x $BBACKUPD || exit 0 +test -f $CONFIG || exit 0 + +case $1 in + start) + echo -n "Starting Box Backup Client daemon: bbackupd" + start-stop-daemon --start --quiet --exec $BBACKUPD > /dev/null + echo "." + ;; + + stop) + echo -n "Stopping Box Backup Client daemon: bbackupd" + start-stop-daemon --stop --quiet \ + --pidfile $PIDFILE --exec $BBACKUPD + echo "." + ;; + + reload|force-reload) + echo -n "Reloading Box Backup Client configuration" + start-stop-daemon --stop --signal 1 --quiet --oknodo \ + --pidfile $PIDFILE --exec $BBACKUPD + echo "." + ;; + + restart) + echo -n "Restarting Box Backup Client daemon: bbackupd" + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $BBACKUPD + start-stop-daemon --start --quiet \ + --exec $BBACKUPD > /dev/null + echo "." + ;; + *) + echo "Usage: /etc/init.d/bbackupd {start|stop|reload|force-reload|restart}" + exit 1 +esac + +exit 0 diff --git a/contrib/debian/bbstored b/contrib/debian/bbstored deleted file mode 100644 index 7a512161..00000000 --- a/contrib/debian/bbstored +++ /dev/null @@ -1,38 +0,0 @@ -#! /bin/sh - -# Start and stop the Box Backup Server. - -test -x /usr/local/bin/bbstored || exit 0 -test -f /etc/box/bbstored.conf || exit 0 - -case $1 in - start) - echo -n "Starting the Box Backup Server daemon: bbstored" - start-stop-daemon --start --quiet --exec /usr/local/bin/bbstored > /dev/null - echo "." - ;; - - stop) - echo -n "Stopping the Box Backup Server daemon: bbstored" - start-stop-daemon --stop --quiet --pidfile /var/run/bbstored.pid --exec /usr/local/bin/bbstored - echo "." - ;; - - reload|force-reload) - echo -n "Reloading the Box Backup Server's configuration" - start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile /var/run/bbstored.pid --exec /usr/local/bin/bbstored - echo "." - ;; - - restart) - echo -n "Restarting the Box Backup Server daemon: bbstored" - start-stop-daemon --stop --quiet --pidfile /var/run/bbstored.pid --exec /usr/local/bin/bbstored - start-stop-daemon --start --quiet --exec /usr/local/bin/bbstored > /dev/null - echo "." - ;; - - *) - echo "Usage /etc/init.d/bbstored {start|stop|reload|force-reload|restart}" -esac - -exit 0 diff --git a/contrib/debian/bbstored.in b/contrib/debian/bbstored.in new file mode 100644 index 00000000..da6a50a0 --- /dev/null +++ b/contrib/debian/bbstored.in @@ -0,0 +1,46 @@ +#! /bin/sh + +# Start and stop the Box Backup server daemon. + +BBSTORED=@bindir_expanded@/bbstored +CONFIG=@sysconfdir_expanded@/box/bbstored.conf +PIDFILE=@localstatedir_expanded@/bbstored.pid + +test -x $BBACKUPD || exit 0 +test -f $CONFIG || exit 0 + +case $1 in + start) + echo -n "Starting Box Backup Server daemon: bbstored" + start-stop-daemon --start --quiet --exec $BBSTORED > /dev/null + echo "." + ;; + + stop) + echo -n "Stopping Box Backup Server daemon: bbstored" + start-stop-daemon --stop --quiet \ + --pidfile $PIDFILE --exec $BBSTORED + echo "." + ;; + + reload|force-reload) + echo -n "Reloading Box Backup Server configuration" + start-stop-daemon --stop --signal 1 --quiet --oknodo \ + --pidfile $PIDFILE --exec $BBSTORED + echo "." + ;; + + restart) + echo -n "Restarting Box Backup Server daemon: bbstored" + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $BBSTORED + start-stop-daemon --start --quiet \ + --exec $BBSTORED > /dev/null + echo "." + ;; + + *) + echo "Usage: /etc/init.d/bbstored {start|stop|reload|force-reload|restart}" +esac + +exit 0 diff --git a/contrib/redhat/bbackupd b/contrib/redhat/bbackupd deleted file mode 100644 index 63c61ff7..00000000 --- a/contrib/redhat/bbackupd +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/bash -# -# bbackupd Start/Stop the box backup daemon. -# -# chkconfig: 345 93 07 -# description: bbackup is the client side deamon for Box Backup, a completely \ -# automatic on-line backup system -# processname: bbackupd -# config: /etc/box -# pidfile: /var/run/bbackupd.pid - -# Source function library. -. /etc/init.d/functions - -RETVAL=0 - -# See how we were called. - -prog="bbackupd" - -# Check that configuration exists. -[ -f /etc/box/$prog.conf ] || exit 0 - -start() { - echo -n $"Starting $prog: " - daemon $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -rhstatus() { - status $prog -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $prog daemon configuration: " - killproc $prog -HUP - retval=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/$prog ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - -exit $? diff --git a/contrib/redhat/bbackupd.in b/contrib/redhat/bbackupd.in new file mode 100644 index 00000000..e8ecdc68 --- /dev/null +++ b/contrib/redhat/bbackupd.in @@ -0,0 +1,83 @@ +#! /bin/bash +# +# bbackupd Start/Stop the box backup client daemon. +# +# chkconfig: 345 93 07 +# description: bbackupd is the client side deamon for Box Backup, \ +# a completely automatic on-line backup system. +# processname: bbackupd +# config: @sysconfdir_expanded@/box +# pidfile: @localstatedir_expanded@/bbackupd.pid + +# Source function library. +. /etc/init.d/functions + +RETVAL=0 + +# See how we were called. + +prog="bbackupd" + +# Check that configuration exists. +[ -f @sysconfdir_expanded@/box/$prog.conf ] || exit 0 + +start() { + echo -n $"Starting $prog: " + daemon $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + return $RETVAL +} + +rhstatus() { + status $prog +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $prog configuration: " + killproc $prog -HUP + retval=$? + echo + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/$prog ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" + exit 1 +esac + +exit $? diff --git a/contrib/redhat/bbstored b/contrib/redhat/bbstored deleted file mode 100644 index eadca1d1..00000000 --- a/contrib/redhat/bbstored +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/bash -# -# bbstored Start/Stop the box backup daemon. -# -# chkconfig: 345 93 07 -# description: bbstore is the server side deamon for Box Backup, a completely \ -# automatic on-line backup system -# processname: bbstored -# config: /etc/box -# pidfile: /var/run/bbstored.pid - -# Source function library. -. /etc/init.d/functions - -RETVAL=0 - -# See how we were called. - -prog="bbstored" - -# Check that configuration exists. -[ -f /etc/box/$prog.conf ] || exit 0 - -start() { - echo -n $"Starting $prog: " - daemon $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog - return $RETVAL -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog - return $RETVAL -} - -rhstatus() { - status $prog -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $prog daemon configuration: " - killproc $prog -HUP - retval=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/$prog ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - -exit $? diff --git a/contrib/redhat/bbstored.in b/contrib/redhat/bbstored.in new file mode 100644 index 00000000..c7675df5 --- /dev/null +++ b/contrib/redhat/bbstored.in @@ -0,0 +1,83 @@ +#! /bin/bash +# +# bbstored Start/Stop the box backup server daemon. +# +# chkconfig: 345 93 07 +# description: bbstored is the server side daemon for Box Backup, \ +# a completely automatic on-line backup system. +# processname: bbstored +# config: @sysconfdir_expanded@/box +# pidfile: @localstatedir_expanded@/bbstored.pid + +# Source function library. +. /etc/init.d/functions + +RETVAL=0 + +# See how we were called. + +prog="bbstored" + +# Check that configuration exists. +[ -f @sysconfdir_expanded@/box/$prog.conf ] || exit 0 + +start() { + echo -n $"Starting $prog: " + daemon $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + return $RETVAL +} + +rhstatus() { + status $prog +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $prog configuration: " + killproc $prog -HUP + retval=$? + echo + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + rhstatus + ;; + condrestart) + [ -f /var/lock/subsys/$prog ] && restart || : + ;; + *) + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" + exit 1 +esac + +exit $? diff --git a/contrib/solaris/bbackupd-smf-method.in b/contrib/solaris/bbackupd-smf-method.in index e7326a78..2c839961 100755 --- a/contrib/solaris/bbackupd-smf-method.in +++ b/contrib/solaris/bbackupd-smf-method.in @@ -1,5 +1,5 @@ -PIDFILE=/var/run/bbackupd.pid +PIDFILE=@localstatedir_expanded@/bbackupd.pid case $1 in diff --git a/contrib/solaris/bbstored-smf-method.in b/contrib/solaris/bbstored-smf-method.in index f9ac8b92..0ea25e40 100755 --- a/contrib/solaris/bbstored-smf-method.in +++ b/contrib/solaris/bbstored-smf-method.in @@ -1,4 +1,4 @@ -PIDFILE=/var/run/bbstored.pid +PIDFILE=@localstatedir_expanded@/bbstored.pid case $1 in diff --git a/contrib/suse/bbackupd b/contrib/suse/bbackupd deleted file mode 100644 index 4dd94154..00000000 --- a/contrib/suse/bbackupd +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -# -# Copyright (c)2004, Nothing But Net Limited -# -# -###################################################################### -# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP -# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: -# -# http://www.fluffy.co.uk/boxbackup/license.html -###################################################################### -# -# /etc/init.d/bbackupd -# and its symbolic link -# /(usr/)sbin/rcbbackupd -# -### BEGIN INIT INFO -# Provides: bbackupd -# Required-Start: $named $network $local_fs $syslog -# X-UnitedLinux-Should-Start: $time ypbind sendmail -# Required-Stop: $named $network $localfs $syslog -# X-UnitedLinux-Should-Stop: $time ypbind sendmail -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: BoxBackup client side daemon -# Description: Client daemon for the BoxBackup software -# that allows you to communicate with a bbstored server. -### END INIT INFO - -# Check for missing binaries (stale symlinks should not happen) -BBACKUPD_BIN=/usr/sbin/bbackupd -if [ ! -x $BBACKUPD_BIN ] ; then - echo "$BBACKUPD_BIN not installed" - exit 5 -fi - -. /etc/rc.status - -# Reset status of this service -rc_reset - -case "$1" in - start) - echo -n "Starting bbackupd " - startproc $BBACKUPD_BIN - rc_status -v - ;; - - stop) - echo -n "Shutting down bbackupd " - killproc -TERM $BBACKUPD_BIN - rc_status -v - ;; - - try-restart|condrestart) - if test "$1" = "condrestart"; then - echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" - fi - $0 status - if test $? = 0; then - $0 restart - else - rc_reset # Not running is not a failure. - fi - rc_status - ;; - - restart) - $0 stop - $0 start - rc_status - ;; - - force-reload) - echo -n "Reload service bbackupd " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - reload) - echo -n "Reload service bbackupd " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - status) - echo -n "Checking for service bbackupd " - checkproc $BBACKUPD_BIN - rc_status -v - ;; - - probe) - test /etc/box/bbackupd.conf -nt /var/run/bbackupd.pid && echo reload - ;; - - *) - echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" - exit 1 - -esac -rc_exit diff --git a/contrib/suse/bbackupd.in b/contrib/suse/bbackupd.in new file mode 100644 index 00000000..d3a5659e --- /dev/null +++ b/contrib/suse/bbackupd.in @@ -0,0 +1,103 @@ +#!/bin/sh +# +# Copyright (c)2004, Nothing But Net Limited +# +# +###################################################################### +# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP +# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: +# +# http://www.boxbackup.org/license.html +###################################################################### +# +# /etc/init.d/bbackupd +# and its symbolic link +# /(usr/)sbin/rcbbackupd +# +### BEGIN INIT INFO +# Provides: bbackupd +# Required-Start: $named $network $local_fs $syslog +# X-UnitedLinux-Should-Start: $time ypbind sendmail +# Required-Stop: $named $network $localfs $syslog +# X-UnitedLinux-Should-Stop: $time ypbind sendmail +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: BoxBackup client side daemon +# Description: Client daemon for the BoxBackup software +# that allows you to communicate with a bbstored server. +### END INIT INFO + +# Check for missing binaries (stale symlinks should not happen) +BBACKUPD_BIN=@bindir_expanded@/bbackupd +if [ ! -x $BBACKUPD_BIN ] ; then + echo "$BBACKUPD_BIN not installed" + exit 5 +fi + +. /etc/rc.status + +# Reset status of this service +rc_reset + +case "$1" in + start) + echo -n "Starting bbackupd " + startproc $BBACKUPD_BIN + rc_status -v + ;; + + stop) + echo -n "Shutting down bbackupd " + killproc -TERM $BBACKUPD_BIN + rc_status -v + ;; + + try-restart|condrestart) + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + rc_status + ;; + + restart) + $0 stop + $0 start + rc_status + ;; + + force-reload) + echo -n "Reload service bbackupd " + killproc -HUP $BBACKUPD_BIN + rc_status -v + ;; + + reload) + echo -n "Reload service bbackupd " + killproc -HUP $BBACKUPD_BIN + rc_status -v + ;; + + status) + echo -n "Checking for service bbackupd " + checkproc $BBACKUPD_BIN + rc_status -v + ;; + + probe) + test @sysconfdir_expanded@/box/bbackupd.conf \ + -nt @localstatedir_expanded@/bbackupd.pid \ + && echo reload + ;; + + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + +esac +rc_exit diff --git a/contrib/suse/bbstored b/contrib/suse/bbstored deleted file mode 100644 index 1824dda7..00000000 --- a/contrib/suse/bbstored +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh -# -# Copyright (c)2004, Nothing But Net Limited -# -# -###################################################################### -# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP -# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: -# -# http://www.fluffy.co.uk/boxbackup/license.html -###################################################################### -# -# /etc/init.d/bbackupd -# and its symbolic link -# /(usr/)sbin/rcbbackupd -# -### BEGIN INIT INFO -# Provides: bbackupd -# Required-Start: $named $network $local_fs $syslog -# X-UnitedLinux-Should-Start: $time ypbind sendmail -# Required-Stop: $named $network $localfs $syslog -# X-UnitedLinux-Should-Stop: $time ypbind sendmail -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: BoxBackup server side daemon -# Description: Client daemon for the BoxBackup software -# that allows you to communicate with a bbstored server. -### END INIT INFO -# - -# Check for missing binaries (stale symlinks should not happen) -BBACKUPD_BIN=/usr/sbin/bbstored -if [ ! -x $BBACKUPD_BIN ] ; then - echo "$BBACKUPD_BIN not installed" - exit 5 -fi - -. /etc/rc.status - -# Reset status of this service -rc_reset - -case "$1" in - start) - echo -n "Starting bbstored " - startproc $BBACKUPD_BIN - rc_status -v - ;; - - stop) - echo -n "Shutting down bstored " - killproc -TERM $BBACKUPD_BIN - rc_status -v - ;; - - try-restart|condrestart) - if test "$1" = "condrestart"; then - echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" - fi - $0 status - if test $? = 0; then - $0 restart - else - rc_reset # Not running is not a failure. - fi - rc_status - ;; - - restart) - $0 stop - $0 start - rc_status - ;; - - force-reload) - echo -n "Reload service bbstored " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - reload) - echo -n "Reload service bbstored " - killproc -HUP $BBACKUPD_BIN - rc_status -v - ;; - - status) - echo -n "Checking for service bbstored " - checkproc $BBACKUPD_BIN - rc_status -v - ;; - - probe) - test /etc/box/bbstored.conf -nt /var/run/bbstored.pid && echo reload - ;; - - *) - echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" - exit 1 - ;; - -esac -rc_exit diff --git a/contrib/suse/bbstored.in b/contrib/suse/bbstored.in new file mode 100644 index 00000000..e8c74278 --- /dev/null +++ b/contrib/suse/bbstored.in @@ -0,0 +1,104 @@ +#!/bin/sh +# +# Copyright (c)2004, Nothing But Net Limited +# +# +###################################################################### +# RELEASED AND PROVIDED TO YOU UNDER THE SAME LICENCE AS THE BOXBACKUP +# SUITE OF PROGRAMS. LICENCE MAY BE VIEWED HERE: +# +# http://www.boxbackup.org/license.html +###################################################################### +# +# /etc/init.d/bbstored +# and its symbolic link +# /(usr/)sbin/rcbbstored +# +### BEGIN INIT INFO +# Provides: bbstored +# Required-Start: $named $network $local_fs $syslog +# X-UnitedLinux-Should-Start: $time ypbind sendmail +# Required-Stop: $named $network $localfs $syslog +# X-UnitedLinux-Should-Stop: $time ypbind sendmail +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: BoxBackup server side daemon +# Description: Server daemon for the BoxBackup software, +# to which bbackupd clients connect. +### END INIT INFO +# + +# Check for missing binaries (stale symlinks should not happen) +BBSTORED_BIN=@bindir_expanded@/bbstored +if [ ! -x $BBSTORED_BIN ] ; then + echo "$BBSTORED_BIN not installed" + exit 5 +fi + +. /etc/rc.status + +# Reset status of this service +rc_reset + +case "$1" in + start) + echo -n "Starting bbstored " + startproc $BBSTORED_BIN + rc_status -v + ;; + + stop) + echo -n "Shutting down bbstored " + killproc -TERM $BBSTORED_BIN + rc_status -v + ;; + + try-restart|condrestart) + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + rc_status + ;; + + restart) + $0 stop + $0 start + rc_status + ;; + + force-reload) + echo -n "Reload service bbstored " + killproc -HUP $BBSTORED_BIN + rc_status -v + ;; + + reload) + echo -n "Reload service bbstored " + killproc -HUP $BBSTORED_BIN + rc_status -v + ;; + + status) + echo -n "Checking for service bbstored " + checkproc $BBSTORED_BIN + rc_status -v + ;; + + probe) + test @sysconfdir_expanded@/box/bbstored.conf \ + -nt @localstatedir_expanded@/bbstored.pid && echo reload + ;; + + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; + +esac +rc_exit -- cgit v1.2.3