From f03c9ed28e60f51fa932dddc982bc4a7b70a7ee9 Mon Sep 17 00:00:00 2001 From: "Paul Emm. Katsoulakis" <34388743+paulkatsoulakis@users.noreply.github.com> Date: Mon, 13 May 2019 15:47:05 +0300 Subject: netdata/packaging: Do not install netdata service when within docker (#5947) * netdata/packaging: Add more to the available distributions, for more consistent installs * Revert "netdata/packaging: Add more to the available distributions, for more consistent installs" This reverts commit d04e664dba2f0a0c69f70615297feb7034839683. This was the wrong approach, what we only want is to basically restrict installing a service for docker installations. There will be a follow up commit for this * netdata/installer: Dont install netdata service scripts when running within docker containers --- netdata-installer.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/netdata-installer.sh b/netdata-installer.sh index dfa14cfe71..3328053a80 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -810,7 +810,12 @@ install_go progress "Install netdata at system init" NETDATA_START_CMD="${NETDATA_PREFIX}/usr/sbin/netdata" -install_netdata_service || run_failed "Cannot install netdata init service." + +if grep -q docker /proc/1/cgroup >/dev/null 2>&1; then + echo >&2 "We are running within a docker container, will not be installing netdata service" +else + install_netdata_service || run_failed "Cannot install netdata init service." +fi # ----------------------------------------------------------------------------- # check if we can re-start netdata -- cgit v1.2.3