forked from netfarm/archiver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.d
executable file
·39 lines (34 loc) · 781 Bytes
/
init.d
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
#! /bin/sh
#
# Written by Gianluigi Tiesi <sherpya@netfarm.it>
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/lib/archiver/archiver.py
PIDFILE=/var/lib/archiver/archiver.pid
NAME=archiver
TIMEOUT=120
DESC="Netfarm Mail archiver"
RUNAS="cyrus"
test -f $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --exec $DAEMON -- -u $RUNAS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --retry $TIMEOUT --pidfile $PIDFILE --stop
echo "$NAME."
;;
restart|force-reload)
$0 stop && sleep 5 && $0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0