0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-15 01:58:34 +00:00
netdata_netdata/packaging/docker/run.sh
Konstantinos Natsakis cac39ebd2d
Rename NETDATA_PORT to NETDATA_LISTENER_PORT ()
Because it clashes with a kubernetes defined NETDATA_PORT variable: Our Helm
chart creates a service called netdata which in turn makes kubernetes export a
NETDATA_PORT environment variable with a value like tcp://<ip>:19999 which is
not parsable by the netdata agent as a value to the `-p` argument.
2020-10-09 15:02:29 +03:00

24 lines
907 B
Bash
Executable file

#!/usr/bin/env bash
#
# Entry point script for netdata
#
# Copyright: SPDX-License-Identifier: GPL-3.0-or-later
#
# Author : Pavlos Emm. Katsoulakis <paul@netdata.cloud>
set -e
if [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
touch /etc/netdata/.opt-out-from-anonymous-statistics
fi
echo "Netdata entrypoint script starting"
if [ -n "${PGID}" ]; then
echo "Creating docker group ${PGID}"
addgroup -g "${PGID}" "docker" || echo >&2 "Could not add group docker with ID ${PGID}, its already there probably"
echo "Assign netdata user to docker group ${PGID}"
usermod -a -G "${PGID}" "${DOCKER_USR}" || echo >&2 "Could not add netdata user to group docker with ID ${PGID}"
fi
exec /usr/sbin/netdata -u "${DOCKER_USR}" -D -s /host -p "${NETDATA_LISTENER_PORT}" -W set web "web files group" root -W set web "web files owner" root "$@"
echo "Netdata entrypoint script, completed!"