summaryrefslogtreecommitdiffstats
path: root/system/netdata-freebsd.in
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--system/netdata-freebsd.in6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/netdata-freebsd.in b/system/netdata-freebsd.in
index fac2e82c2..300ddc9ec 100644
--- a/system/netdata-freebsd.in
+++ b/system/netdata-freebsd.in
@@ -1,11 +1,13 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-3.0-or-later
. /etc/rc.subr
name=netdata
rcvar=netdata_enable
-pidfile="@localstatedir_POST@/run/netdata.pid"
+piddir="@localstatedir_POST@/run/netdata"
+pidfile="${pidfile}/netdata.pid"
command="@sbindir_POST@/netdata"
command_args="-P ${pidfile}"
@@ -22,11 +24,13 @@ savedb_cmd="netdata_savedb"
netdata_prestart()
{
+ [ ! -d "${piddir}" ] && mkdir -p "${piddir}"
return 0
}
netdata_poststop()
{
+ [ -f "${pidfile}" ] && rm "${pidfile}"
return 0
}