@cryptotaxi247 / netdata-1 / commits / 26b2efaa9

netdata.service is now installed in /lib/systemd/system; fixes #4087

Costa Tsaousis (ktsaou) committed Sep 10, 2018 at 18:57 UTC 26b2efaa9b323d23d8fc53320dacfda8a3f4d88b
4 files changed +13 -8
installer/functions.sh
+5 -6
@@ -439,8 +439,8 @@ iscontainer() {
439 issystemd() {
440 local pids p myns ns systemctl
441
442 - # if the directory /etc/systemd/system does not exit, it is not systemd
443 - [ ! -d /etc/systemd/system ] && return 1
442 + # if the directory /lib/systemd/system does not exit, it is not systemd
443 + [ ! -d /lib/systemd/system ] && return 1
444
445 # if there is no systemctl command, it is not systemd
446 systemctl=$(which systemctl 2>/dev/null || command -v systemctl 2>/dev/null)
@@ -560,16 +560,15 @@ install_netdata_service() {
560 NETDATA_START_CMD="systemctl start netdata"
561 NETDATA_STOP_CMD="systemctl stop netdata"
562
563 - if [ ! -f /etc/systemd/system/netdata.service ]
563 + if [ -d "/lib/systemd/system" ]
564 then
565 echo >&2 "Installing systemd service..."
566 - run cp system/netdata.service /etc/systemd/system/netdata.service && \
566 + run cp system/netdata.service /lib/systemd/system/netdata.service && \
567 run systemctl daemon-reload && \
568 run systemctl enable netdata && \
569 return 0
570 else
571 - echo >&2 "file '/etc/systemd/system/netdata.service' already exists."
572 - return 0
571 + echo >&2 "no '/lib/systemd/system' directory; cannot install netdata.service"
572 fi
573 else
574 install_non_systemd_init
makeself/makeself-help-header.txt
+1 -1
@@ -26,7 +26,7 @@
26 # SYSTEM INIT
27 This file will be installed if this system runs with systemd:
28
29 - - /etc/systemd/system/netdata.service
29 + - /lib/systemd/system/netdata.service
30
31 or, for older Centos, Debian/Ubuntu or OpenRC Gentoo:
32
makeself/makeself-license.txt
+1 -1
@@ -26,7 +26,7 @@
26 # SYSTEM INIT
27 This file will be installed if this system runs with systemd:
28
29 - - /etc/systemd/system/netdata.service
29 + - /lib/systemd/system/netdata.service
30
31 or, for older Centos, Debian/Ubuntu or OpenRC Gentoo:
32
netdata-installer.sh
+6
@@ -1069,6 +1069,12 @@ if [ -f /etc/systemd/system/netdata.service ]
1069 run rm -i /etc/systemd/system/netdata.service
1070 fi
1071
1072 +if [ -f /lib/systemd/system/netdata.service ]
1073 + then
1074 + echo "Deleting /lib/systemd/system/netdata.service ..."
1075 + run rm -i /lib/systemd/system/netdata.service
1076 +fi
1077 +
1078 if [ -f /etc/init.d/netdata ]
1079 then
1080 echo "Deleting /etc/init.d/netdata ..."