summaryrefslogtreecommitdiffstats
path: root/system/runit/run.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:04 +0000
commita836a244a3d2bdd4da1ee2641e3e957850668cea (patch)
treecb87c75b3677fab7144f868435243f864048a1e6 /system/runit/run.in
parentAdding upstream version 1.38.1. (diff)
downloadnetdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.tar.xz
netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.zip
Adding upstream version 1.39.0.upstream/1.39.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'system/runit/run.in')
-rw-r--r--system/runit/run.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/runit/run.in b/system/runit/run.in
new file mode 100644
index 000000000..4ea783cc6
--- /dev/null
+++ b/system/runit/run.in
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+piddir="@localstatedir_POST@/run/netdata/netdata.pid"
+pidfile="${piddir}/netdata.pid"
+
+cachedir="@localstatedir_POST@/cache/netdata"
+
+command="@sbindir_POST@/netdata"
+command_args="-P ${pidfile} -D"
+
+[ ! -d "${piddir}" ] && mkdir -p "${piddir}"
+[ ! -d "${cachedir}" ] && mkdir -p "${cachedir}"
+chown -R @netdata_user_POST@ "${piddir}"
+chown -R @netdata_user_POST@ "${cachedir}"
+
+exec ${command} ${command_args}