diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-12-28 14:38:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-12-28 14:38:58 +0000 |
commit | fa4ece01aed54c9a146af868be0d3db611ded229 (patch) | |
tree | 319cffc5f6c2abd7cce514383716153469fc6295 /installer/functions.sh | |
parent | New upstream version 1.11.0+dfsg (diff) | |
download | netdata-fa4ece01aed54c9a146af868be0d3db611ded229.tar.xz netdata-fa4ece01aed54c9a146af868be0d3db611ded229.zip |
New upstream version 1.11.1+dfsgupstream/1.11.1+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'installer/functions.sh')
-rw-r--r-- | installer/functions.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/installer/functions.sh b/installer/functions.sh index dc2833318..155edd79a 100644 --- a/installer/functions.sh +++ b/installer/functions.sh @@ -441,8 +441,8 @@ iscontainer() { issystemd() { local pids p myns ns systemctl - # if the directory /lib/systemd/system does not exit, it is not systemd - [ ! -d /lib/systemd/system ] && return 1 + # if the directory /lib/systemd/system OR /usr/lib/systemd/system (SLES 12.x) does not exit, it is not systemd + [ ! -d /lib/systemd/system -a ! -d /usr/lib/systemd/system ] && return 1 # if there is no systemctl command, it is not systemd # shellcheck disable=SC2230 @@ -563,15 +563,25 @@ install_netdata_service() { NETDATA_START_CMD="systemctl start netdata" NETDATA_STOP_CMD="systemctl stop netdata" + SYSTEMD_DIRECTORY="" + if [ -d "/lib/systemd/system" ] then + SYSTEMD_DIRECTORY="/lib/systemd/system" + elif [ -d "/usr/lib/systemd/system" ] + then + SYSTEMD_DIRECTORY="/usr/lib/systemd/system" + fi + + if [ "${SYSTEMD_DIRECTORY}x" != "x" ] + then echo >&2 "Installing systemd service..." - run cp system/netdata.service /lib/systemd/system/netdata.service && \ + run cp system/netdata.service "${SYSTEMD_DIRECTORY}/netdata.service" && \ run systemctl daemon-reload && \ run systemctl enable netdata && \ return 0 else - echo >&2 "no '/lib/systemd/system' directory; cannot install netdata.service" + echo >&2 "no systemd directory; cannot install netdata.service" fi else install_non_systemd_init |