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 committed
May 13, 2019 at 15:47 UTC
f03c9ed28e60f51fa932dddc982bc4a7b70a7ee9
1 file changed
+6
-1
netdata-installer.sh
+6
-1
@@ -810,7 +810,12 @@ install_go
810
progress "Install netdata at system init"
811
812
NETDATA_START_CMD="${NETDATA_PREFIX}/usr/sbin/netdata"
813
-install_netdata_service || run_failed "Cannot install netdata init service."
813
+
814
+if grep -q docker /proc/1/cgroup >/dev/null 2>&1; then
815
+ echo >&2 "We are running within a docker container, will not be installing netdata service"
816
+else
817
+ install_netdata_service || run_failed "Cannot install netdata init service."
818
+fi
819
820
# -----------------------------------------------------------------------------
821
# check if we can re-start netdata