summaryrefslogtreecommitdiffstats
path: root/system/netdata-init-d.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-init-d.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-init-d.in')
-rw-r--r--system/netdata-init-d.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/netdata-init-d.in b/system/netdata-init-d.in
index 90a4b95be..9ac510196 100644
--- a/system/netdata-init-d.in
+++ b/system/netdata-init-d.in
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-3.0-or-later
#
# netdata Real-time performance monitoring, done right
# chkconfig: 345 99 01
@@ -13,7 +14,8 @@
DAEMON="netdata"
DAEMON_PATH=@sbindir_POST@
-PIDFILE=@localstatedir_POST@/run/$DAEMON.pid
+PIDFILE_PATH=@localstatedir_POST@/run/netdata
+PIDFILE=$PIDFILE_PATH/$DAEMON.pid
DAEMONOPTS="-P $PIDFILE"
STOP_TIMEOUT="60"
@@ -24,6 +26,7 @@ LOCKFILE=/var/lock/subsys/$DAEMON
service_start()
{
[ -x $DAEMON_PATH ] || exit 5
+ [ ! -d $PIDFILE_PATH ] && mkdir -p $PIDFILE_PATH
echo -n "Starting $DAEMON..."
daemon $DAEMON_PATH/$DAEMON $DAEMONOPTS
RETVAL=$?