diff options
author | Alon Bar-Lev <alon.barlev@gmail.com> | 2016-04-03 00:08:55 +0300 |
---|---|---|
committer | Alon Bar-Lev <alon.barlev@gmail.com> | 2016-04-03 00:13:10 +0300 |
commit | 458de8ae0d3c3da5626a30a2077a5116e09254cb (patch) | |
tree | 799521d581527672f7f33e97d1835dcfa140472a | |
parent | 8ee3cdc8ef057a9070712fd921d6a0cee01f51d5 (diff) |
build: revert pid to live within /var/run/netdata
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>
-rwxr-xr-x | netdata-installer.sh | 2 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rwxr-xr-x | src/daemon.c | 2 | ||||
-rwxr-xr-x | src/main.c | 2 | ||||
-rwxr-xr-x | system/netdata-openrc | 2 | ||||
-rw-r--r-- | system/netdata.service.in | 2 |
6 files changed, 6 insertions, 5 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 82c46ffcc6..88333478d9 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index 3af4e909a8..f2c15e9221 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 = \ diff --git a/src/daemon.c b/src/daemon.c index 22d8f7fc88..1428a6153f 100755 --- a/src/daemon.c +++ b/src/daemon.c @@ -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) { diff --git a/src/main.c b/src/main.c index a1b278f494..a28e39171a 100755 --- a/src/main.c +++ b/src/main.c @@ -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); } diff --git a/system/netdata-openrc b/system/netdata-openrc index 756a521bd9..202db64c0b 100755 --- a/system/netdata-openrc +++ b/system/netdata-openrc @@ -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" diff --git a/system/netdata.service.in b/system/netdata.service.in index 094670ffc3..266bc65b1c 100644 --- a/system/netdata.service.in +++ b/system/netdata.service.in @@ -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 |