diff options
Diffstat (limited to '')
-rwxr-xr-x | netdata-installer.sh | 301 |
1 files changed, 163 insertions, 138 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 8fd6e3875..f59bc2b34 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -29,27 +29,6 @@ if [ "${NETDATA_SOURCE_DIR}" != "${INSTALLER_DIR}" ] && [ "${INSTALLER_DIR}" != fi # ----------------------------------------------------------------------------- -# Pull in OpenSSL properly if on macOS -if [ "$(uname -s)" = 'Darwin' ]; then - if brew --prefix > /dev/null 2>&1; then - if brew --prefix --installed openssl > /dev/null 2>&1; then - HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl) - elif brew --prefix --installed openssl@3 > /dev/null 2>&1; then - HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@3) - elif brew --prefix --installed openssl@1.1 > /dev/null 2>&1; then - HOMEBREW_OPENSSL_PREFIX=$(brew --prefix --installed openssl@1.1) - fi - if [ -n "${HOMEBREW_OPENSSL_PREFIX}" ]; then - export CFLAGS="${CFLAGS} -I${HOMEBREW_OPENSSL_PREFIX}/include" - export LDFLAGS="${LDFLAGS} -L${HOMEBREW_OPENSSL_PREFIX}/lib" - fi - HOMEBREW_PREFIX=$(brew --prefix) - export CFLAGS="${CFLAGS} -I${HOMEBREW_PREFIX}/include" - export LDFLAGS="${LDFLAGS} -L${HOMEBREW_PREFIX}/lib" - fi -fi - -# ----------------------------------------------------------------------------- # reload the user profile # shellcheck source=/dev/null @@ -207,7 +186,7 @@ banner_root_notify() { Netdata will work, but a few data collection modules that require root access will fail. - If you installing netdata permanently on your system, run + If you are installing netdata permanently on your system, run the installer like this: ${TPUT_YELLOW}${TPUT_BOLD}sudo $PROGRAM ${@}${TPUT_RESET} @@ -223,50 +202,47 @@ usage() { USAGE: ${PROGRAM} [options] where options include: - --install <path> Install netdata in <path>. Ex. --install /opt will put netdata in /opt/netdata - --dont-start-it Do not (re)start netdata after installation - --dont-wait Run installation in non-interactive mode - --auto-update or -u Install netdata-updater in cron to update netdata automatically once per day - --auto-update-type Override the auto-update scheduling mechanism detection, currently supported types - are: systemd, interval, crontab - --stable-channel Use packages from GitHub release pages instead of GCS (nightly updates). + --install <path> Install netdata in <path>. Ex. --install /opt will put netdata in /opt/netdata. + --dont-start-it Do not (re)start netdata after installation. + --dont-wait Run installation in non-interactive mode. + --stable-channel Use packages from GitHub release pages instead of nightly updates. This results in less frequent updates. --nightly-channel Use most recent nightly updates instead of GitHub releases. This results in more frequent updates. --disable-go Disable installation of go.d.plugin. - --disable-ebpf Disable eBPF Kernel plugin (Default: enabled) + --disable-ebpf Disable eBPF Kernel plugin. Default: enabled. --disable-cloud Disable all Netdata Cloud functionality. --require-cloud Fail the install if it can't build Netdata Cloud support. --enable-plugin-freeipmi Enable the FreeIPMI plugin. Default: enable it when libipmimonitoring is available. - --disable-plugin-freeipmi - --disable-https Explicitly disable TLS support - --disable-dbengine Explicitly disable DB engine support + --disable-plugin-freeipmi Explicitly disable the FreeIPMI plugin. + --disable-https Explicitly disable TLS support. + --disable-dbengine Explicitly disable DB engine support. --enable-plugin-nfacct Enable nfacct plugin. Default: enable it when libmnl and libnetfilter_acct are available. - --disable-plugin-nfacct - --enable-plugin-xenstat Enable the xenstat plugin. Default: enable it when libxenstat and libyajl are available - --disable-plugin-xenstat Disable the xenstat plugin. - --enable-backend-kinesis Enable AWS Kinesis backend. Default: enable it when libaws_cpp_sdk_kinesis and libraries - it depends on are available. - --disable-backend-kinesis - --enable-backend-prometheus-remote-write Enable Prometheus remote write backend. Default: enable it when libprotobuf and - libsnappy are available. - --disable-backend-prometheus-remote-write - --enable-backend-mongodb Enable MongoDB backend. Default: enable it when libmongoc is available. - --disable-backend-mongodb + --disable-plugin-nfacct Explicitly disable the nfacct plugin. + --enable-plugin-xenstat Enable the xenstat plugin. Default: enable it when libxenstat and libyajl are available. + --disable-plugin-xenstat Explicitly disable the xenstat plugin. + --enable-exporting-kinesis Enable AWS Kinesis exporting connector. Default: enable it when libaws_cpp_sdk_kinesis + and its dependencies are available. + --disable-exporting-kinesis Explicitly disable AWS Kinesis exporting connector. + --enable-exporting-prometheus-remote-write Enable Prometheus remote write exporting connector. Default: enable it + when libprotobuf and libsnappy are available. + --disable-exporting-prometheus-remote-write Explicitly disable Prometheus remote write exporting connector. + --enable-exporting-mongodb Enable MongoDB exporting connector. Default: enable it when libmongoc is available. + --disable-exporting-mongodb Explicitly disable MongoDB exporting connector. --enable-exporting-pubsub Enable Google Cloud PubSub exporting connector. Default: enable it when libgoogle_cloud_cpp_pubsub_protos and its dependencies are available. - --disable-exporting-pubsub - --enable-lto Enable Link-Time-Optimization. Default: disabled - --disable-lto - --enable-ml Enable anomaly detection with machine learning. (Default: autodetect) - --disable-ml - --disable-x86-sse Disable SSE instructions. By default SSE optimizations are enabled. - --use-system-lws Use a system copy of libwebsockets instead of bundling our own (default is to use the bundled copy). - --use-system-protobuf Use a system copy of libprotobuf instead of bundling our own (default is to use the bundled copy). - --zlib-is-really-here or - --libs-are-really-here If you get errors about missing zlib or libuuid but you know it is available, you might + --disable-exporting-pubsub Explicitly disable Google Cloud PubSub exporting connector. + --enable-lto Enable link-time optimization. Default: disabled. + --disable-lto Explicitly disable link-time optimization. + --enable-ml Enable anomaly detection with machine learning. Default: autodetect. + --disable-ml Explicitly disable anomaly detection with machine learning. + --disable-x86-sse Disable SSE instructions & optimizations. Default: enabled. + --use-system-lws Use a system copy of libwebsockets instead of bundled copy. Default: bundled. + --use-system-protobuf Use a system copy of libprotobuf instead of bundled copy. Default: bundled. + --zlib-is-really-here + --libs-are-really-here If you see errors about missing zlib or libuuid but you know it is available, you might have a broken pkg-config. Use this option to proceed without checking pkg-config. - --disable-telemetry Use this flag to opt-out from our anonymous telemetry program. (DO_NOT_TRACK=1) + --disable-telemetry Opt-out from our anonymous telemetry program. (DISABLE_TELEMETRY=1) --skip-available-ram-check Skip checking the amount of RAM the system has and pretend it has enough to build safely. Netdata will by default be compiled with gcc optimization -O2 @@ -284,7 +260,13 @@ or use the following if both LDFLAGS and CFLAGS need to be overridden: For the installer to complete successfully, you will need these packages installed: - gcc make autoconf automake pkg-config zlib1g-dev (or zlib-devel) uuid-dev (or libuuid-devel) + gcc + make + autoconf + automake + pkg-config + zlib1g-dev (or zlib-devel) + uuid-dev (or libuuid-devel) For the plugins, you will at least need: @@ -295,12 +277,11 @@ HEREDOC DONOTSTART=0 DONOTWAIT=0 -AUTOUPDATE=0 NETDATA_PREFIX= LIBS_ARE_HERE=0 NETDATA_ENABLE_ML="" NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS-}" -RELEASE_CHANNEL="nightly" # check .travis/create_artifacts.sh before modifying +RELEASE_CHANNEL="nightly" # valid values are 'nightly' and 'stable' IS_NETDATA_STATIC_BINARY="${IS_NETDATA_STATIC_BINARY:-"no"}" while [ -n "${1}" ]; do case "${1}" in @@ -313,19 +294,8 @@ while [ -n "${1}" ]; do "--dont-scrub-cflags-even-though-it-may-break-things") DONT_SCRUB_CFLAGS_EVEN_THOUGH_IT_MAY_BREAK_THINGS=1 ;; "--dont-start-it") DONOTSTART=1 ;; "--dont-wait") DONOTWAIT=1 ;; - "--auto-update" | "-u") AUTOUPDATE=1 ;; - "--auto-update-type") - AUTO_UPDATE_TYPE="$(echo "${2}" | tr '[:upper:]' '[:lower:]')" - case "${AUTO_UPDATE_TYPE}" in - systemd|interval|crontab) - shift 1 - ;; - *) - echo "Unrecognized value for --auto-update-type. Valid values are: systemd, interval, crontab" - exit 1 - ;; - esac - ;; + "--auto-update" | "-u") ;; + "--auto-update-type") ;; "--stable-channel") RELEASE_CHANNEL="stable" ;; "--nightly-channel") RELEASE_CHANNEL="nightly" ;; "--enable-plugin-freeipmi") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-plugin-freeipmi)}" | sed 's/$/ --enable-plugin-freeipmi/g')" ;; @@ -339,15 +309,20 @@ while [ -n "${1}" ]; do "--disable-plugin-nfacct") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-plugin-nfacct)}" | sed 's/$/ --disable-plugin-nfacct/g')" ;; "--enable-plugin-xenstat") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-plugin-xenstat)}" | sed 's/$/ --enable-plugin-xenstat/g')" ;; "--disable-plugin-xenstat") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-plugin-xenstat)}" | sed 's/$/ --disable-plugin-xenstat/g')" ;; - "--enable-backend-kinesis") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-backend-kinesis)}" | sed 's/$/ --enable-backend-kinesis/g')" ;; - "--disable-backend-kinesis") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-backend-kinesis)}" | sed 's/$/ --disable-backend-kinesis/g')" ;; - "--enable-backend-prometheus-remote-write") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-backend-prometheus-remote-write)}" | sed 's/$/ --enable-backend-prometheus-remote-write/g')" ;; - "--disable-backend-prometheus-remote-write") - NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-backend-prometheus-remote-write)}" | sed 's/$/ --disable-backend-prometheus-remote-write/g')" + "--enable-exporting-kinesis" | "--enable-backend-kinesis") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-exporting-kinesis)}" | sed 's/$/ --enable-exporting-kinesis/g')" ;; + "--disable-exporting-kinesis" | "--disable-backend-kinesis") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-exporting-kinesis)}" | sed 's/$/ --disable-exporting-kinesis/g')" ;; + "--enable-exporting-prometheus-remote-write" | "--enable-backend-prometheus-remote-write") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-exporting-prometheus-remote-write)}" | sed 's/$/ --enable-exporting-prometheus-remote-write/g')" ;; + "--disable-exporting-prometheus-remote-write" | "--disable-backend-prometheus-remote-write") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-exporting-prometheus-remote-write)}" | sed 's/$/ --disable-exporting-prometheus-remote-write/g')" NETDATA_DISABLE_PROMETHEUS=1 ;; - "--enable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-backend-mongodb)}" | sed 's/$/ --enable-backend-mongodb/g')" ;; - "--disable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-backend-mongodb)}" | sed 's/$/ --disable-backend-mongodb/g')" ;; + "--enable-exporting-mongodb" | "--enable-backend-mongodb") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-exporting-mongodb)}" | sed 's/$/ --enable-exporting-mongodb/g')" ;; + "--disable-exporting-mongodb" | "--disable-backend-mongodb") + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-exporting-mongodb)}" | sed 's/$/ --disable-exporting-mongodb/g')" ;; "--enable-exporting-pubsub") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-exporting-pubsub)}" | sed 's/$/ --enable-exporting-pubsub/g')" ;; "--disable-exporting-pubsub") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-exporting-pubsub)}" | sed 's/$/ --disable-exporting-pubsub/g')" ;; "--enable-lto") NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--enable-lto)}" | sed 's/$/ --enable-lto/g')" ;; @@ -411,6 +386,13 @@ while [ -n "${1}" ]; do shift 1 done +if [ ! "${DISABLE_TELEMETRY:-0}" -eq 0 ] || + [ -n "$DISABLE_TELEMETRY" ] || + [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || + [ -n "$DO_NOT_TRACK" ]; then + NETDATA_DISABLE_TELEMETRY=1 +fi + make="make" # See: https://github.com/netdata/netdata/issues/9163 if [ "$(uname -s)" = "FreeBSD" ]; then @@ -515,8 +497,8 @@ if [ -z "$NETDATA_DISABLE_TELEMETRY" ]; then ${TPUT_YELLOW}${TPUT_BOLD}NOTE${TPUT_RESET}: Anonymous usage stats will be collected and sent to Netdata. To opt-out, pass --disable-telemetry option to the installer or export - the environment variable DO_NOT_TRACK to a non-zero or non-empty value - (e.g: export DO_NOT_TRACK=1). + the environment variable DISABLE_TELEMETRY to a non-zero or non-empty value + (e.g: export DISABLE_TELEMETRY=1). BANNER4 fi @@ -688,7 +670,7 @@ bundle_protobuf() { "${PROTOBUF_PACKAGE_BASENAME}" \ "${tmp}" \ "${NETDATA_LOCAL_TARBALL_VERRIDE_PROTOBUF}"; then - if run tar -xf "${tmp}/${PROTOBUF_PACKAGE_BASENAME}" -C "${tmp}" && + if run tar --no-same-owner -xf "${tmp}/${PROTOBUF_PACKAGE_BASENAME}" -C "${tmp}" && build_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" && copy_protobuf "${tmp}/protobuf-${PROTOBUF_PACKAGE_VERSION}" && rm -rf "${tmp}"; then @@ -773,7 +755,7 @@ bundle_judy() { "${JUDY_PACKAGE_BASENAME}" \ "${tmp}" \ "${NETDATA_LOCAL_TARBALL_OVERRIDE_JUDY}"; then - if run tar -xf "${tmp}/${JUDY_PACKAGE_BASENAME}" -C "${tmp}" && + if run tar --no-same-owner -xf "${tmp}/${JUDY_PACKAGE_BASENAME}" -C "${tmp}" && build_judy "${tmp}/libjudy-${JUDY_PACKAGE_VERSION}" && copy_judy "${tmp}/libjudy-${JUDY_PACKAGE_VERSION}" && rm -rf "${tmp}"; then @@ -857,7 +839,7 @@ bundle_jsonc() { "${JSONC_PACKAGE_BASENAME}" \ "${tmp}" \ "${NETDATA_LOCAL_TARBALL_OVERRIDE_JSONC}"; then - if run tar -xf "${tmp}/${JSONC_PACKAGE_BASENAME}" -C "${tmp}" && + if run tar --no-same-owner -xf "${tmp}/${JSONC_PACKAGE_BASENAME}" -C "${tmp}" && build_jsonc "${tmp}/json-c-json-c-${JSONC_PACKAGE_VERSION}" && copy_jsonc "${tmp}/json-c-json-c-${JSONC_PACKAGE_VERSION}" && rm -rf "${tmp}"; then @@ -891,6 +873,37 @@ get_kernel_version() { printf "%03d%03d%03d" "${maj}" "${min}" "${patch}" } +detect_libc() { + libc= + if ldd --version 2>&1 | grep -q -i glibc; then + echo >&2 " Detected GLIBC" + libc="glibc" + elif ldd --version 2>&1 | grep -q -i 'gnu libc'; then + echo >&2 " Detected GLIBC" + libc="glibc" + elif ldd --version 2>&1 | grep -q -i musl; then + echo >&2 " Detected musl" + libc="musl" + else + ls_path=$(command -v ls) + if [ -n "${ls_path}" ] ; then + cmd=$(ldd "$ls_path" | grep -w libc | cut -d" " -f 3) + if bash -c "${cmd}" 2>&1 | grep -q -i "GNU C Library"; then + echo >&2 " Detected GLIBC" + libc="glibc" + fi + fi + fi + + if [ -z "$libc" ]; then + echo >&2 " ERROR: Cannot detect a supported libc on your system!" + return 1 + fi + + echo "${libc}" + return 0 +} + rename_libbpf_packaging() { if [ "$(get_kernel_version)" -ge "004014000" ]; then cp packaging/current_libbpf.checksums packaging/libbpf.checksums @@ -923,6 +936,7 @@ copy_libbpf() { run cp "${1}/usr/${lib_subdir}/libbpf.a" "${target_dir}/libbpf.a" || return 1 run cp -r "${1}/usr/include" "${target_dir}" || return 1 + run cp -r "${1}/include/uapi" "${target_dir}/include" || return 1 } bundle_libbpf() { @@ -930,6 +944,14 @@ bundle_libbpf() { return 0 fi + # When libc is not detected, we do not have necessity to compile libbpf and we should not do download of eBPF programs + libc="${EBPF_LIBC:-"$(detect_libc)"}" + if [ -z "$libc" ]; then + NETDATA_DISABLE_EBPF=1 + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-ebpf)}" | sed 's/$/ --disable-ebpf/g')" + return 0 + fi + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libbpf." rename_libbpf_packaging @@ -946,7 +968,7 @@ bundle_libbpf() { "${LIBBPF_PACKAGE_BASENAME}" \ "${tmp}" \ "${NETDATA_LOCAL_TARBALL_OVERRIDE_LIBBPF}"; then - if run tar -xf "${tmp}/${LIBBPF_PACKAGE_BASENAME}" -C "${tmp}" && + if run tar --no-same-owner -xf "${tmp}/${LIBBPF_PACKAGE_BASENAME}" -C "${tmp}" && build_libbpf "${tmp}/libbpf-${LIBBPF_PACKAGE_VERSION}" && copy_libbpf "${tmp}/libbpf-${LIBBPF_PACKAGE_VERSION}" && rm -rf "${tmp}"; then @@ -973,6 +995,59 @@ bundle_libbpf() { bundle_libbpf +copy_co_re() { + cp -R "${1}/includes" "collectors/ebpf.plugin/" +} + +bundle_ebpf_co_re() { + if { [ -n "${NETDATA_DISABLE_EBPF}" ] && [ ${NETDATA_DISABLE_EBPF} = 1 ]; } || [ "$(uname -s)" != Linux ]; then + return 0 + fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::group::Bundling libbpf." + + progress "eBPF CO-RE" + + CORE_PACKAGE_VERSION="$(cat packaging/ebpf-co-re.version)" + + tmp="$(mktemp -d -t netdata-ebpf-co-re-XXXXXX)" + CORE_PACKAGE_BASENAME="netdata-ebpf-co-re-glibc-${CORE_PACKAGE_VERSION}.tar.xz" + + if fetch_and_verify "ebpf-co-re" \ + "https://github.com/netdata/ebpf-co-re/releases/download/${CORE_PACKAGE_VERSION}/${CORE_PACKAGE_BASENAME}" \ + "${CORE_PACKAGE_BASENAME}" \ + "${tmp}" \ + "${NETDATA_LOCAL_TARBALL_OVERRIDE_CORE}"; then + if run tar --no-same-owner -xf "${tmp}/${CORE_PACKAGE_BASENAME}" -C "${tmp}" && + copy_co_re "${tmp}" && + rm -rf "${tmp}"; then + run_ok "libbpf built and prepared." + else + run_failed "Failed to get eBPF CO-RE files." + if [ -n "${NETDATA_DISABLE_EBPF}" ] && [ ${NETDATA_DISABLE_EBPF} = 0 ]; then + exit 1 + else + defer_error_highlighted "Failed to get CO-RE. You will not be able to use eBPF plugin." + NETDATA_DISABLE_EBPF=1 + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-ebpf)}" | sed 's/$/ --disable-ebpf/g')" + fi + fi + else + run_failed "Unable to fetch sources for libbpf." + if [ -n "${NETDATA_DISABLE_EBPF}" ] && [ ${NETDATA_DISABLE_EBPF} = 0 ]; then + exit 1 + else + defer_error_highlighted "Unable to fetch sources for eBPF CO-RE. You will not be able to use eBPF plugin." + NETDATA_DISABLE_EBPF=1 + NETDATA_CONFIGURE_OPTIONS="$(echo "${NETDATA_CONFIGURE_OPTIONS%--disable-ebpf)}" | sed 's/$/ --disable-ebpf/g')" + fi + fi + + [ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::" +} + +bundle_ebpf_co_re + # ----------------------------------------------------------------------------- # If we have the dashboard switching logic, make sure we're on the classic # dashboard during the install (updates don't work correctly otherwise). @@ -1062,14 +1137,6 @@ if [ -d "${NETDATA_PREFIX}/etc/netdata" ]; then run mkdir "${NETDATA_PREFIX}/etc/netdata/node.d" fi - # move the node.d config files - for x in named sma_webbox snmp; do - for y in "" ".old" ".orig"; do - if [ -f "${NETDATA_PREFIX}/etc/netdata/${x}.conf${y}" ] && [ ! -f "${NETDATA_PREFIX}/etc/netdata/node.d/${x}.conf${y}" ]; then - run mv -f "${NETDATA_PREFIX}/etc/netdata/${x}.conf${y}" "${NETDATA_PREFIX}/etc/netdata/node.d/${x}.conf${y}" - fi - done - done fi # ----------------------------------------------------------------------------- @@ -1200,15 +1267,6 @@ NETDATA_GROUP="$(id -g -n "${NETDATA_USER}")" [ -z "${NETDATA_GROUP}" ] && NETDATA_GROUP="${NETDATA_USER}" echo >&2 "Netdata user and group is finally set to: ${NETDATA_USER}/${NETDATA_GROUP}" -# the owners of the web files -NETDATA_WEB_USER="$(config_option "web" "web files owner" "${NETDATA_USER}")" -NETDATA_WEB_GROUP="${NETDATA_GROUP}" -if [ "$(id -u)" = "0" ] && [ "${NETDATA_USER}" != "${NETDATA_WEB_USER}" ]; then - NETDATA_WEB_GROUP="$(id -g -n "${NETDATA_WEB_USER}")" - [ -z "${NETDATA_WEB_GROUP}" ] && NETDATA_WEB_GROUP="${NETDATA_WEB_USER}" -fi -NETDATA_WEB_GROUP="$(config_option "web" "web files group" "${NETDATA_WEB_GROUP}")" - # port defport=19999 NETDATA_PORT="$(config_option "web" "default port" ${defport})" @@ -1228,8 +1286,6 @@ cat << OPTIONSEOF Permissions - netdata user : ${NETDATA_USER} - netdata group : ${NETDATA_GROUP} - - web files user : ${NETDATA_WEB_USER} - - web files group : ${NETDATA_WEB_GROUP} - root user : ${ROOT_USER} Directories @@ -1274,7 +1330,6 @@ if [ ! -d "${NETDATA_WEB_DIR}" ]; then echo >&2 "Creating directory '${NETDATA_WEB_DIR}'" run mkdir -p "${NETDATA_WEB_DIR}" || exit 1 fi -run chown -R "${NETDATA_WEB_USER}:${NETDATA_WEB_GROUP}" "${NETDATA_WEB_DIR}" run find "${NETDATA_WEB_DIR}" -type f -exec chmod 0664 {} \; run find "${NETDATA_WEB_DIR}" -type d -exec chmod 0775 {} \; @@ -1534,10 +1589,10 @@ install_go() { # Install new files run rm -rf "${NETDATA_STOCK_CONFIG_DIR}/go.d" run rm -rf "${NETDATA_STOCK_CONFIG_DIR}/go.d.conf" - run tar -xf "${tmp}/config.tar.gz" -C "${NETDATA_STOCK_CONFIG_DIR}/" + run tar --no-same-owner -xf "${tmp}/config.tar.gz" -C "${NETDATA_STOCK_CONFIG_DIR}/" run chown -R "${ROOT_USER}:${ROOT_GROUP}" "${NETDATA_STOCK_CONFIG_DIR}" - run tar -xf "${tmp}/${GO_PACKAGE_BASENAME}" + run tar --no-same-owner -xf "${tmp}/${GO_PACKAGE_BASENAME}" run mv "${GO_PACKAGE_BASENAME%.tar.gz}" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" if [ "$(id -u)" -eq 0 ]; then run chown "root:${NETDATA_GROUP}" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" @@ -1550,25 +1605,6 @@ install_go() { install_go -detect_libc() { - libc= - if ldd --version 2>&1 | grep -q -i glibc; then - echo >&2 " Detected GLIBC" - libc="glibc" - elif ldd --version 2>&1 | grep -q -i 'gnu libc'; then - echo >&2 " Detected GLIBC" - libc="glibc" - elif ldd --version 2>&1 | grep -q -i musl; then - echo >&2 " Detected musl" - libc="musl" - else - echo >&2 " ERROR: Cannot detect a supported libc on your system!" - return 1 - fi - echo "${libc}" - return 0 -} - should_install_ebpf() { if [ "${NETDATA_DISABLE_EBPF:=0}" -eq 1 ]; then run_failed "eBPF explicitly disabled." @@ -1606,7 +1642,7 @@ remove_old_ebpf() { mv "${NETDATA_PREFIX}/etc/netdata/ebpf_process.conf" "${NETDATA_PREFIX}/etc/netdata/ebpf.d.conf" fi - # Added to remove eBPF programs with name pattern: NAME_VERSION.SUBVERSION.PATCH + # Added to remove eBPF programs with name pattern: NAME_VERSION.SUBVERSION.PATCH if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/pnetdata_ebpf_process.3.10.0.o" ]; then echo >&2 "Removing old eBPF programs with patch." rm -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/rnetdata_ebpf"*.?.*.*.o @@ -1666,7 +1702,7 @@ install_ebpf() { fi echo >&2 " Extracting ${EBPF_TARBALL} ..." - tar -xf "${tmp}/${EBPF_TARBALL}" -C "${tmp}" + tar --no-same-owner -xf "${tmp}/${EBPF_TARBALL}" -C "${tmp}" # chown everything to root:netdata before we start copying out of our package run chown -R root:netdata "${tmp}" @@ -1695,10 +1731,6 @@ install_ebpf # ----------------------------------------------------------------------------- progress "Telemetry configuration" -if [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then - NETDATA_DISABLE_TELEMETRY=1 -fi - # Opt-out from telemetry program if [ -n "${NETDATA_DISABLE_TELEMETRY+x}" ]; then run touch "${NETDATA_USER_CONFIG_DIR}/.opt-out-from-anonymous-statistics" @@ -1887,13 +1919,6 @@ progress "Installing (but not enabling) the netdata updater tool" cleanup_old_netdata_updater || run_failed "Cannot cleanup old netdata updater tool." install_netdata_updater || run_failed "Cannot install netdata updater tool." -progress "Check if we must enable/disable the netdata updater tool" -if [ "${AUTOUPDATE}" = "1" ]; then - enable_netdata_updater "${AUTO_UPDATE_TYPE}" || run_failed "Cannot enable netdata updater tool" -else - disable_netdata_updater || run_failed "Cannot disable netdata updater tool" -fi - # ----------------------------------------------------------------------------- progress "Wrap up environment set up" |