summaryrefslogtreecommitdiffstats
path: root/system/netdata-freebsd.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:22:44 +0000
commit1e6c93250172946eeb38e94a92a1fd12c9d3011e (patch)
tree8ca5e16dfc7ad6b3bf2738ca0a48408a950f8f7e /system/netdata-freebsd.in
parentUpdate watch file (diff)
downloadnetdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.tar.xz
netdata-1e6c93250172946eeb38e94a92a1fd12c9d3011e.zip
Merging upstream version 1.11.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'system/netdata-freebsd.in')
-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
}