aboutsummaryrefslogtreecommitdiffstats
path: root/main/backuppc/backuppc.initd
blob: 31dce63970b7db2a4a8a6f5f39a7457493c84cc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/sbin/openrc-run
BACKUPPC_BINDIR=/usr/lib/BackupPC/bin
DAEMON=BackupPC
BACKUPPC_LOGDIR=/var/log/BackupPC
USER=backuppc

depend() {
	after firewall modules
}


configure () {
	chown $USER $BACKUPPC_LOGDIR
	chmod a+x $BACKUPPC_BINDIR/*
	test -x $BACKUPPC_BINDIR/$DAEMON || exit 0
}

start() {
	ebegin "Starting $DAEMON"
	start-stop-daemon --start --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \
	  --user $USER --exec $BACKUPPC_BINDIR/$DAEMON -- -d
	eend $?
}

stop () {
	ebegin "Stopping $DAEMON"
	start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \
	  --retry 30 -x /usr/bin/perl
	eend $?
}

restart () {
	start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \
	  --retry 30 -x /usr/bin/perl
	start-stop-daemon --start --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \
	  --user $USER --exec $BACKUPPC_BINDIR/$DAEMON -- -d
}

reload () {
	start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \
	  --signal 1 -x /usr/bin/perl
}