diff options
Diffstat (limited to 'testing/lsyncd/lsyncd.initd')
-rw-r--r-- | testing/lsyncd/lsyncd.initd | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/testing/lsyncd/lsyncd.initd b/testing/lsyncd/lsyncd.initd index 9dfddd405d..5578b1a2af 100644 --- a/testing/lsyncd/lsyncd.initd +++ b/testing/lsyncd/lsyncd.initd @@ -2,25 +2,31 @@ NAME=lsyncd DAEMON=/usr/bin/$NAME -USER=daemon -CONF=/etc/lsyncd/lrsync.lua +PIDFILE=/var/run/$NAME.pid +USER=root +GROUP=root +CONF=/etc/lsyncd/lsyncd.lua depend() { - need net + need net } start() { - ebegin "Starting $NAME" - start-stop-daemon --start --quiet \ - --user $USER \ - --exec $DAEMON -- \ - $CONF - eend $? + 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 \ - --exec $DAEMON - eend $? + ebegin "Stopping $NAME" + start-stop-daemon --stop --quiet \ + --pidfile "$PIDFILE" + eend $? } |