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.initd32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/lsyncd/lsyncd.initd b/main/lsyncd/lsyncd.initd
new file mode 100644
index 0000000000..5578b1a2af
--- /dev/null
+++ b/main/lsyncd/lsyncd.initd
@@ -0,0 +1,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 $?
+}