1#!/bin/sh 2### BEGIN INIT INFO 3# Provides: backuppc 4# Required-Start: $syslog $network $remote_fs 5# Required-Stop: $syslog $network $remote_fs 6# Should-Start: $local_fs 7# Should-Stop: $local_fs 8# Default-Start: 2 3 4 5 9# Default-Stop: 0 1 6 10# Short-Description: Launch backuppc server 11# Description: Launch backuppc server, a high-performance, 12# enterprise-grade system for backing up PCs. 13### END INIT INFO 14# DESCRIPTION 15# 16# Startup init script for BackupPC on Debian. 17# 18# Distributed with BackupPC version 4.4.0, released 20 Jun 2020. 19# 20 21set -e 22 23# 24BINDIR=__INSTALLDIR__/bin 25DATADIR=__TOPDIR__ 26RUNDIR=__RUNDIR__ 27USER=__BACKUPPCUSER__ 28# 29NAME=backuppc 30DAEMON=BackupPC 31 32test -x $BINDIR/$DAEMON || exit 0 33 34if [ ! -d $RUNDIR ]; then 35 mkdir -p $RUNDIR 36 chown $USER $RUNDIR 37 chmod 0755 $RUNDIR 38fi 39 40case "$1" in 41 start) 42 echo -n "Starting $NAME: " 43 start-stop-daemon --start --pidfile $RUNDIR/BackupPC.pid \ 44 -c $USER --exec $BINDIR/$DAEMON -- -d 45 echo "ok." 46 ;; 47 stop) 48 echo -n "Stopping $NAME: " 49 start-stop-daemon --stop --pidfile $RUNDIR/BackupPC.pid -u $USER \ 50 --oknodo --retry 30 -x /usr/bin/perl 51 echo "ok." 52 ;; 53 restart) 54 echo -n "Restarting $NAME: " 55 start-stop-daemon --stop --pidfile $RUNDIR/BackupPC.pid -u $USER \ 56 --oknodo --retry 30 -x /usr/bin/perl 57 start-stop-daemon --start --pidfile $RUNDIR/BackupPC.pid \ 58 -c $USER --exec $BINDIR/$DAEMON -- -d 59 echo "ok." 60 ;; 61 reload|force-reload) 62 echo "Reloading $NAME configuration files" 63 start-stop-daemon --stop --pidfile $RUNDIR/BackupPC.pid \ 64 --signal 1 -x /usr/bin/perl 65 ;; 66 *) 67 echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}" 68 exit 1 69 ;; 70esac 71 72exit 0 73