aboutsummaryrefslogtreecommitdiffstats
path: root/main/lsyncd/lsyncd.initd
blob: 5578b1a2afa5919594a752890db2c569afe93e0c (plain)
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
#!/sbin/runscript

NAME=lsyncd
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
USER=root
GROUP=root
CONF=/etc/lsyncd/lsyncd.lua

depend() {
	need net
}

start() {
	touch "$PIDFILE"
	chown $USER:$GROUP "$PIDFILE"
	ebegin "Starting $NAME"
		start-stop-daemon --start --quiet \
			--pidfile "$PIDFILE" \
			--user "$USER" --group "$GROUP" \
			--chdir /etc/lsyncd \
			--exec "$DAEMON" -- \
			"$CONF" -pidfile "$PIDFILE"
	eend $?
}

stop() {
	ebegin "Stopping $NAME"
		start-stop-daemon --stop --quiet \
			--pidfile "$PIDFILE"
	eend $?
}