summaryrefslogtreecommitdiffstats
path: root/system/runit/run.in
blob: 4ea783cc6cb9ebb3fcc54fc3951efe4eea61413f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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}