added new file init.d/src/debian-backuppc
authorcbarratt <cbarratt>
Fri, 20 Sep 2002 07:24:33 +0000 (07:24 +0000)
committercbarratt <cbarratt>
Fri, 20 Sep 2002 07:24:33 +0000 (07:24 +0000)
init.d/src/debian-backuppc [new file with mode: 0755]

diff --git a/init.d/src/debian-backuppc b/init.d/src/debian-backuppc
new file mode 100755 (executable)
index 0000000..f1274c4
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# DESCRIPTION
+#
+#   Startup init script for BackupPC on Debian.
+#
+# Distributed with BackupPC version __VERSION__, released __RELEASEDATE__.
+#
+
+set -e
+
+#
+BINDIR=__INSTALLDIR__/bin
+DATADIR=__TOPDIR__
+USER=__BACKUPPCUSER__
+#
+NAME=backuppc
+DAEMON=BackupPC
+
+test -x $BINDIR/$DAEMON || exit 0
+
+case "$1" in
+  start)
+    echo -n "Starting $NAME: "
+    start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
+                           -c $USER --exec $BINDIR/$DAEMON -- -d
+    echo "ok."
+    ;;
+  stop)
+    echo -n "Stopping $NAME: "
+    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+                           --oknodo --retry 30 -x /usr/bin/perl
+    echo "ok."
+      ;;
+  restart)
+    echo -n "Restarting $NAME: "
+    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
+                           --oknodo --retry 30 -x /usr/bin/perl
+    start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
+                           -c $USER --exec $BINDIR/$DAEMON -- -d
+    echo "ok."
+    ;;
+  reload|force-reload)
+    echo "Reloading $NAME configuration files"
+    start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid \
+                           --signal 1 -x /usr/bin/perl
+    ;;
+  *)
+    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
+    exit 1
+    ;;
+esac
+
+exit 0