summaryrefslogtreecommitdiffstats
path: root/packaging/installer/functions.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
commit574098461cd45be12a497afbdac6f93c58978387 (patch)
tree9eb60a5930b7c20d42f7fde1e234cae3968ed3d9 /packaging/installer/functions.sh
parentAdding upstream version 1.16.1. (diff)
downloadnetdata-574098461cd45be12a497afbdac6f93c58978387.tar.xz
netdata-574098461cd45be12a497afbdac6f93c58978387.zip
Adding upstream version 1.17.0.upstream/1.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/functions.sh')
-rw-r--r--packaging/installer/functions.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh
index 6f9996906..2e3044340 100644
--- a/packaging/installer/functions.sh
+++ b/packaging/installer/functions.sh
@@ -380,10 +380,17 @@ install_netdata_service() {
fi
if [ "${SYSTEMD_DIRECTORY}x" != "x" ]; then
+ ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED="run systemctl enable netdata"
+ IS_NETDATA_ENABLED="$(systemctl is-enabled netdata 2> /dev/null || echo "Netdata not there")"
+ if [ "${IS_NETDATA_ENABLED}" == "disabled" ]; then
+ echo >&2 "Netdata was there and disabled, make sure we don't re-enable it ourselves"
+ ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED="true"
+ fi
+
echo >&2 "Installing systemd service..."
run cp system/netdata.service "${SYSTEMD_DIRECTORY}/netdata.service" &&
run systemctl daemon-reload &&
- run systemctl enable netdata &&
+ ${ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED} &&
return 0
else
echo >&2 "no systemd directory; cannot install netdata.service"