Browse Source

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
Paul Emm. Katsoulakis 5 years ago
parent
commit
f03c9ed28e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      netdata-installer.sh

+ 6 - 1
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