X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=init.d%2Fsrc%2Fdebian-backuppc;fp=init.d%2Fsrc%2Fdebian-backuppc;h=f1274c407bacd65e8b8c605e830863db5c06e224;hp=0000000000000000000000000000000000000000;hb=338b5484b3ed421b6bd30ab8c7925e54d670b474;hpb=743f47e5eb2fecb4ae0913564600ef37420fe1c6;ds=sidebyside diff --git a/init.d/src/debian-backuppc b/init.d/src/debian-backuppc new file mode 100755 index 0000000..f1274c4 --- /dev/null +++ b/init.d/src/debian-backuppc @@ -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