summaryrefslogtreecommitdiff
path: root/contrib/debian
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2009-04-02 13:58:11 +0200
committerReinhard Tartler <siretart@tauware.de>2009-04-02 13:58:11 +0200
commita84d45498bd861c9225080232948a99c2e317bb8 (patch)
tree8f1f5fb7bf7ffbf6f24cf4a4fd6888a235dbcc08 /contrib/debian
parent25db897553a0db0f912602b375029e724f51556e (diff)
Import upstream version 0.11~rc3~r2491
Diffstat (limited to 'contrib/debian')
-rw-r--r--contrib/debian/bbackupd.in63
-rw-r--r--contrib/debian/bbstored.in57
2 files changed, 73 insertions, 47 deletions
diff --git a/contrib/debian/bbackupd.in b/contrib/debian/bbackupd.in
index 78d4f4ee..bb7536b5 100644
--- a/contrib/debian/bbackupd.in
+++ b/contrib/debian/bbackupd.in
@@ -1,46 +1,59 @@
#! /bin/sh
# Start and stop the Box Backup client daemon.
+# Originally by James Stark, modified by Chris Wilson and James O'Gorman
+# For support, visit http://www.boxbackup.org/trac/wiki/MailingLists
-BBACKUPD=@bindir_expanded@/bbackupd
-CONFIG=@sysconfdir_expanded@/box/bbackupd.conf
-PIDFILE=@localstatedir_expanded@/bbackupd.pid
+NAME=bbackupd
+LONGNAME="Box Backup Client daemon"
+BINARY=@sbindir_expanded@/$NAME
+CONFIG=@sysconfdir_expanded@/box/$NAME.conf
+PIDFILE=@localstatedir_expanded@/bbackupd/$NAME.pid
-test -x $BBACKUPD || exit 0
+test -x $BINARY || exit 0
test -f $CONFIG || exit 0
+start_stop() {
+ start-stop-daemon --quiet --exec $BINARY --pidfile $PIDFILE "$@"
+}
+
+start_stop_verbose() {
+ if start_stop "$@"; then
+ echo "."
+ else
+ echo " failed!"
+ exit 1
+ fi
+}
+
case $1 in
start)
- echo -n "Starting Box Backup Client daemon: bbackupd"
- start-stop-daemon --start --quiet --exec $BBACKUPD > /dev/null
- echo "."
+ echo -n "Starting $LONGNAME: $NAME"
+ start_stop_verbose --start
;;
-
+
stop)
- echo -n "Stopping Box Backup Client daemon: bbackupd"
- start-stop-daemon --stop --quiet \
- --pidfile $PIDFILE --exec $BBACKUPD
- echo "."
+ echo -n "Stopping $LONGNAME: $NAME"
+ start_stop_verbose --stop
;;
reload|force-reload)
- echo -n "Reloading Box Backup Client configuration"
- start-stop-daemon --stop --signal 1 --quiet --oknodo \
- --pidfile $PIDFILE --exec $BBACKUPD
- echo "."
+ echo -n "Reloading $LONGNAME configuration"
+ start_stop_verbose --stop --signal 1
;;
-
+
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 -n "Restarting $LONGNAME: $NAME"
+ if start_stop --stop --retry 5 && start_stop --start; then
+ echo "."
+ else
+ echo " failed!"
+ exit 1
+ fi
;;
+
*)
- echo "Usage: /etc/init.d/bbackupd {start|stop|reload|force-reload|restart}"
- exit 1
+ echo "Usage: $0 {start|stop|reload|force-reload|restart}"
esac
exit 0
diff --git a/contrib/debian/bbstored.in b/contrib/debian/bbstored.in
index da6a50a0..48fc47f1 100644
--- a/contrib/debian/bbstored.in
+++ b/contrib/debian/bbstored.in
@@ -1,46 +1,59 @@
#! /bin/sh
# Start and stop the Box Backup server daemon.
+# Originally by James Stark, modified by Chris Wilson and James O'Gorman
+# For support, visit http://www.boxbackup.org/trac/wiki/MailingLists
-BBSTORED=@bindir_expanded@/bbstored
-CONFIG=@sysconfdir_expanded@/box/bbstored.conf
-PIDFILE=@localstatedir_expanded@/bbstored.pid
+NAME=bbstored
+LONGNAME="Box Backup Server daemon"
+BINARY=@sbindir_expanded@/$NAME
+CONFIG=@sysconfdir_expanded@/box/$NAME.conf
+PIDFILE=@localstatedir_expanded@/run/$NAME.pid
-test -x $BBACKUPD || exit 0
+test -x $BINARY || exit 0
test -f $CONFIG || exit 0
+start_stop() {
+ start-stop-daemon --quiet --exec $BINARY --pidfile $PIDFILE "$@"
+}
+
+start_stop_verbose() {
+ if start_stop "$@"; then
+ echo "."
+ else
+ echo " failed!"
+ exit 1
+ fi
+}
+
case $1 in
start)
- echo -n "Starting Box Backup Server daemon: bbstored"
- start-stop-daemon --start --quiet --exec $BBSTORED > /dev/null
- echo "."
+ echo -n "Starting $LONGNAME: $NAME"
+ start_stop_verbose --start
;;
stop)
- echo -n "Stopping Box Backup Server daemon: bbstored"
- start-stop-daemon --stop --quiet \
- --pidfile $PIDFILE --exec $BBSTORED
- echo "."
+ echo -n "Stopping $LONGNAME: $NAME"
+ start_stop_verbose --stop
;;
reload|force-reload)
- echo -n "Reloading Box Backup Server configuration"
- start-stop-daemon --stop --signal 1 --quiet --oknodo \
- --pidfile $PIDFILE --exec $BBSTORED
- echo "."
+ echo -n "Reloading $LONGNAME configuration"
+ start_stop_verbose --stop --signal 1
;;
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 -n "Restarting $LONGNAME: $NAME"
+ if start_stop --stop --retry 5 && start_stop --start; then
+ echo "."
+ else
+ echo " failed!"
+ exit 1
+ fi
;;
*)
- echo "Usage: /etc/init.d/bbstored {start|stop|reload|force-reload|restart}"
+ echo "Usage: $0 {start|stop|reload|force-reload|restart}"
esac
exit 0