]> arthur.barton.de Git - netdata.git/commitdiff
build: revert pid to live within /var/run/netdata
authorAlon Bar-Lev <alon.barlev@gmail.com>
Sat, 2 Apr 2016 21:08:55 +0000 (00:08 +0300)
committerAlon Bar-Lev <alon.barlev@gmail.com>
Sat, 2 Apr 2016 21:13:10 +0000 (00:13 +0300)
as pid processing is non standard fixing mechanism is out of scope.

fix C code to follow the autoconf location.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
netdata-installer.sh
src/Makefile.am
src/daemon.c
src/main.c
system/netdata-openrc
system/netdata.service.in

index 82c46ffcc66965f0e53541f2fb8308504f49b0a2..88333478d9ba08108cde8890ba4f93ce414770bb 100755 (executable)
@@ -314,7 +314,7 @@ do
 
        count=$((count + 1))
 
-       pid=$(cat /var/run/netdata.pid 2>/dev/null)
+       pid=$(cat /var/run/netdata/netdata.pid 2>/dev/null)
        isnetdata $pid || pid=
        if [ ! -z "${pid}" ]
                then
index 3af4e909a89469e82e772bcefdbc26d469a23408..f2c15e92216b216dc61101f424f83450cb463988 100644 (file)
@@ -8,6 +8,7 @@ AM_CPPFLAGS = \
        -DCONFIG_DIR="\"$(configdir)\"" \
        -DLOG_DIR="\"$(logdir)\"" \
        -DPLUGINS_DIR="\"$(pluginsdir)\"" \
+       -DRUN_DIR="\"$(localstatedir)/run/netdata\"" \
        -DWEB_DIR="\"$(webdir)\"" \
        $(NULL)
 AM_CFLAGS = \
index 22d8f7fc88ad6ba112fe9c5fa5ca36086d2e453c..1428a6153f7e232152770c109327431af8255148 100755 (executable)
@@ -71,7 +71,7 @@ void sig_handler(int signo)
        }
 }
 
-char rundir[FILENAME_MAX + 1] = "/var/run/netdata";
+char rundir[FILENAME_MAX + 1] = RUN_DIR;
 char pidfile[FILENAME_MAX + 1] = "";
 void prepare_rundir() {
        if(getuid() != 0) {
index a1b278f494bdb043ba6e209863f11b76c7635fdf..a28e39171ab3a9523c842d62fc816ca3e30173c5 100755 (executable)
@@ -44,7 +44,7 @@ void netdata_cleanup_and_exit(int ret)
        netdata_exit = 1;
        rrdset_save_all();
        // kill_childs();
-       unlink("/var/run/netdata.pid");
+       unlink(RUN_DIR "netdata.pid");
        info("NetData exiting. Bye bye...");
        exit(ret);
 }
index 756a521bd9e0a7391ee1b6e346b7c4b100d7f93c..202db64c0b97e4f5f0183d506922c40593691d9f 100755 (executable)
@@ -26,7 +26,7 @@ NETDATA_FORCE_EXIT=${NETDATA_FORCE_EXIT-0}
 NETDATA_START_AFTER_SERVICES="${NETDATA_START_AFTER_SERVICES-apache2 squid nginx mysql named opensips upsd hostapd postfix lm_sensors}"
 
 extra_started_commands="getconf"
-pidfile="/var/run/netdata.pid"
+pidfile="/var/run/netdata/netdata.pid"
 command="${NETDATA_INSTALL_PATH}/usr/sbin/netdata"
 command_background="yes"
 
index 094670ffc308a5f5c7b0a60259dc55511e46a8d8..266bc65b1c4fe732363c9eb512d6dc37be114c2d 100644 (file)
@@ -7,7 +7,7 @@ Type=forking
 WorkingDirectory=/tmp
 User=root
 Group=root
-PIDFile=@localstatedir_POST@/run/netdata.pid
+PIDFile=@localstatedir_POST@/run/netdata/netdata.pid
 ExecStart=@sbindir_POST@/netdata
 ExecStop=/bin/kill -SIGTERM $MAINPID
 TimeoutStopSec=30