diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2018-09-10 18:57:50 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2018-09-10 18:57:50 +0300 |
commit | 26b2efaa9b323d23d8fc53320dacfda8a3f4d88b (patch) | |
tree | fc58ea0b563cbd970b001153d73cccfd62e66e50 | |
parent | 89bf2f92e56527226575a460aec7ab57db9dc4b6 (diff) |
netdata.service is now installed in /lib/systemd/system; fixes #4087
-rw-r--r-- | installer/functions.sh | 11 | ||||
-rw-r--r-- | makeself/makeself-help-header.txt | 2 | ||||
-rw-r--r-- | makeself/makeself-license.txt | 2 | ||||
-rwxr-xr-x | netdata-installer.sh | 6 |
4 files changed, 13 insertions, 8 deletions
diff --git a/installer/functions.sh b/installer/functions.sh index e1267bd654..fcb8044aa5 100644 --- a/installer/functions.sh +++ b/installer/functions.sh @@ -439,8 +439,8 @@ iscontainer() { issystemd() { local pids p myns ns systemctl - # if the directory /etc/systemd/system does not exit, it is not systemd - [ ! -d /etc/systemd/system ] && return 1 + # if the directory /lib/systemd/system does not exit, it is not systemd + [ ! -d /lib/systemd/system ] && return 1 # if there is no systemctl command, it is not systemd systemctl=$(which systemctl 2>/dev/null || command -v systemctl 2>/dev/null) @@ -560,16 +560,15 @@ install_netdata_service() { NETDATA_START_CMD="systemctl start netdata" NETDATA_STOP_CMD="systemctl stop netdata" - if [ ! -f /etc/systemd/system/netdata.service ] + if [ -d "/lib/systemd/system" ] then echo >&2 "Installing systemd service..." - run cp system/netdata.service /etc/systemd/system/netdata.service && \ + run cp system/netdata.service /lib/systemd/system/netdata.service && \ run systemctl daemon-reload && \ run systemctl enable netdata && \ return 0 else - echo >&2 "file '/etc/systemd/system/netdata.service' already exists." - return 0 + echo >&2 "no '/lib/systemd/system' directory; cannot install netdata.service" fi else install_non_systemd_init diff --git a/makeself/makeself-help-header.txt b/makeself/makeself-help-header.txt index e264900590..6ed85386df 100644 --- a/makeself/makeself-help-header.txt +++ b/makeself/makeself-help-header.txt @@ -26,7 +26,7 @@ # SYSTEM INIT This file will be installed if this system runs with systemd: - - /etc/systemd/system/netdata.service + - /lib/systemd/system/netdata.service or, for older Centos, Debian/Ubuntu or OpenRC Gentoo: diff --git a/makeself/makeself-license.txt b/makeself/makeself-license.txt index e264900590..6ed85386df 100644 --- a/makeself/makeself-license.txt +++ b/makeself/makeself-license.txt @@ -26,7 +26,7 @@ # SYSTEM INIT This file will be installed if this system runs with systemd: - - /etc/systemd/system/netdata.service + - /lib/systemd/system/netdata.service or, for older Centos, Debian/Ubuntu or OpenRC Gentoo: diff --git a/netdata-installer.sh b/netdata-installer.sh index c63f7ede94..c7c19cd14f 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -1069,6 +1069,12 @@ if [ -f /etc/systemd/system/netdata.service ] run rm -i /etc/systemd/system/netdata.service fi +if [ -f /lib/systemd/system/netdata.service ] + then + echo "Deleting /lib/systemd/system/netdata.service ..." + run rm -i /lib/systemd/system/netdata.service +fi + if [ -f /etc/init.d/netdata ] then echo "Deleting /etc/init.d/netdata ..." |