aboutsummaryrefslogtreecommitdiffstats
path: root/main/lsyncd/lsyncd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/lsyncd/lsyncd.initd')
-rw-r--r--main/lsyncd/lsyncd.initd37
1 files changed, 13 insertions, 24 deletions
diff --git a/main/lsyncd/lsyncd.initd b/main/lsyncd/lsyncd.initd
index 5578b1a2af..6299c36978 100644
--- a/main/lsyncd/lsyncd.initd
+++ b/main/lsyncd/lsyncd.initd
@@ -1,32 +1,21 @@
#!/sbin/runscript
-NAME=lsyncd
-DAEMON=/usr/bin/$NAME
-PIDFILE=/var/run/$NAME.pid
-USER=root
-GROUP=root
-CONF=/etc/lsyncd/lsyncd.lua
+command=/usr/bin/lsyncd
+pidfile=/var/run/lsyncd/${SVCNAME}.pid
+conf=/etc/lsyncd/${SVCNAME}.lua
+
+: ${exec_user:=root}
+: ${exec_group:=root}
+
+start_stop_daemon_args="--user $exec_user --group $exec_group --chdir /etc/lsyncd"
depend() {
need net
+ after firewall
}
-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 $?
+start_pre() {
+ command_args="$conf -pidfile $pidfile $command_args"
+ checkpath --directory ${pidfile%/*} --owner ${exec_user}:${exec_group}
+ command_args="$conf -pidfile $pidfile $command_args"
}