@cryptotaxi247 / netdata-1 / commits / 3ae3f926a

Sanely handle installing on systems with limited RAM. (#11658)

* Add check for available RAM prior to installing. * Properly mark required shell for kickstart.sh It needs bash, and we only ever run it with bash, so make the shebang line indicate bash. This resolves a bunch of shellcheck complaints. * Add installation failure reporting statistics. The new event is called INSTALL_FAILED, and mostly mirrors a subset of the existing properties on the various agent events. * Fix error messages. * Fix checksums. * Apply suggestions from code review Co-authored-by: David Shreve, Jr. <david@netdata.cloud> * Fix kickstart checksums. * Fix memory calculations. They were off by a factor of 1024. * Fix kernel name handling. * Fix checksums. * Fix core count accounting. * Add a CLI option to skip checking for available RAM. * Addressed review feedback. * Update netdata-installer.sh Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud> * Add RAM checking for ML builds. * Update packaging/installer/kickstart.sh Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud> * Update packaging/installer/kickstart.sh Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud> * Fix kickstart checksum. * Re-adjust memory limiting based on discussion from meeting. * Switch from using SI units to IEC units. * Fix typo. Co-authored-by: David Shreve, Jr. <david@netdata.cloud> Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>

Austin S. Hemmelgarn committed Nov 4, 2021 at 13:26 UTC 3ae3f926af55ff6befab0f535fc72185e73fbd7d
3 files changed +183 -41
netdata-installer.sh
+58 -9
@@ -118,12 +118,6 @@ download_go() {
118 # make sure we save all commands we run
119 run_logfile="netdata-installer.log"
120
121 -# set default make options
122 -if [ -z "${MAKEOPTS}" ]; then
123 - MAKEOPTS="-j$(find_processors)"
124 -elif echo "${MAKEOPTS}" | grep -vqF -e "-j"; then
125 - MAKEOPTS="${MAKEOPTS} -j$(find_processors)"
126 -fi
121
122 # -----------------------------------------------------------------------------
123 # fix PKG_CHECK_MODULES error
@@ -250,6 +244,7 @@ USAGE: ${PROGRAM} [options]
244 --libs-are-really-here If you get errors about missing zlib or libuuid but you know it is available, you might
245 have a broken pkg-config. Use this option to proceed without checking pkg-config.
246 --disable-telemetry Use this flag to opt-out from our anonymous telemetry program. (DO_NOT_TRACK=1)
247 + --skip-available-ram-check Skip checking the amount of RAM the system has and pretend it has enough to build safely.
248
249 Netdata will by default be compiled with gcc optimization -O2
250 If you need to pass different CFLAGS, use something like this:
@@ -280,6 +275,7 @@ DONOTWAIT=0
275 AUTOUPDATE=0
276 NETDATA_PREFIX=
277 LIBS_ARE_HERE=0
278 +NETDATA_ENABLE_ML=""
279 NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS-}"
280 RELEASE_CHANNEL="nightly" # check .travis/create_artifacts.sh before modifying
281 IS_NETDATA_STATIC_BINARY="${IS_NETDATA_STATIC_BINARY:-"no"}"
@@ -331,8 +327,14 @@ while [ -n "${1}" ]; do
327 "--enable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-backend-mongodb/} --enable-backend-mongodb" ;;
328 "--disable-backend-mongodb") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-backend-mongodb/} --disable-backend-mongodb" ;;
329 "--enable-lto") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-lto/} --enable-lto" ;;
334 - "--enable-ml") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-ml/} --enable-ml" ;;
335 - "--disable-ml") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ml/} --disable-ml" ;;
330 + "--enable-ml")
331 + NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-ml/} --enable-ml"
332 + NETDATA_ENABLE_ML=1
333 + ;;
334 + "--disable-ml")
335 + NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ml/} --disable-ml"
336 + NETDATA_ENABLE_ML=0
337 + ;;
338 "--enable-ml-tests") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-ml-tests/} --enable-ml-tests" ;;
339 "--disable-ml-tests") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ml-tests/} --disable-ml-tests" ;;
340 "--disable-lto") NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-lto/} --disable-lto" ;;
@@ -341,6 +343,7 @@ while [ -n "${1}" ]; do
343 "--disable-go") NETDATA_DISABLE_GO=1 ;;
344 "--enable-ebpf") NETDATA_DISABLE_EBPF=0 ;;
345 "--disable-ebpf") NETDATA_DISABLE_EBPF=1 NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ebpf/} --disable-ebpf" ;;
346 + "--skip-available-ram-check") SKIP_RAM_CHECK=1 ;;
347 "--aclk-ng") ;;
348 "--aclk-legacy")
349 NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--with-aclk-legacy/} --with-aclk-legacy"
@@ -398,6 +401,52 @@ fi
401 # replace multiple spaces with a single space
402 NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS// / }"
403
404 +if [ "$(uname -s)" = "Linux" ] && [ -f /proc/meminfo ]; then
405 + mega="$((1024 * 1024))"
406 + base=1024
407 + scale=256
408 +
409 + if [ -n "${MAKEOPTS}" ]; then
410 + proc_count="$(echo ${MAKEOPTS} | grep -oE '\-j *[[:digit:]]+' | tr -d '\-j ')"
411 + else
412 + proc_count="$(find_processors)"
413 + fi
414 +
415 + target_ram="$((base * mega + (scale * mega * (proc_count - 1))))"
416 + total_ram="$(grep MemTotal /proc/meminfo | cut -d ':' -f 2 | tr -d ' kB')"
417 + total_ram="$((total_ram * 1024))"
418 +
419 + if [ "${total_ram}" -le "$((base * mega))" ] && [ -z "${NETDATA_ENABLE_ML}" ]; then
420 + NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-ml/} --disable-ml"
421 + NETDATA_ENABLE_ML=0
422 + fi
423 +
424 + if [ -z "${MAKEOPTS}" ]; then
425 + MAKEOPTS="-j${proc_count}"
426 +
427 + while [ "${target_ram}" -gt "${total_ram}" ] && [ "${proc_count}" -gt 1 ]; do
428 + proc_count="$((proc_count - 1))"
429 + target_ram="$((base * mega + (scale * mega * (proc_count - 1))))"
430 + MAKEOPTS="-j${proc_count}"
431 + done
432 + else
433 + if [ "${target_ram}" -gt "${total_ram}" ] && [ "${proc_count}" -gt 1 ] && [ -z "${SKIP_RAM_CHECK}" ]; then
434 + target_ram="$(echo "${target_ram}" | awk '{$1/=1024*1024*1024;printf "%.2fGiB\n",$1}')"
435 + total_ram="$(echo "${total_ram}" | awk '{$1/=1024*1024*1024;printf "%.2fGiB\n",$1}')"
436 + run_failed "Netdata needs ${target_ram} of RAM to safely install, but this system only has ${total_ram}."
437 + run_failed "Insufficient RAM available for an install. Try reducing the number of processes used for the install using the \$MAKEOPTS variable."
438 + exit 2
439 + fi
440 + fi
441 +fi
442 +
443 +# set default make options
444 +if [ -z "${MAKEOPTS}" ]; then
445 + MAKEOPTS="-j$(find_processors)"
446 +elif echo "${MAKEOPTS}" | grep -vqF -e "-j"; then
447 + MAKEOPTS="${MAKEOPTS} -j$(find_processors)"
448 +fi
449 +
450 if [ "${UID}" -ne 0 ]; then
451 if [ -z "${NETDATA_PREFIX}" ]; then
452 netdata_banner "wrong command line options!"
@@ -855,7 +904,7 @@ copy_judy() {
904
905 bundle_judy() {
906 # If --build-judy flag or no Judy on the system and we're building the dbengine, bundle our own libJudy.
858 - # shellcheck disable=SC2235
907 + # shellcheck disable=SC2235,SC2030,SC2031
908 if [ -n "${NETDATA_DISABLE_DBENGINE}" ] || ([ -z "${NETDATA_BUILD_JUDY}" ] && [ -e /usr/include/Judy.h ]); then
909 return 0
910 elif [ -n "${NETDATA_BUILD_JUDY}" ]; then
packaging/installer/kickstart.sh
+124 -31
@@ -1,4 +1,4 @@
1 -#!/usr/bin/env sh
1 +#!/usr/bin/env bash
2 # SPDX-License-Identifier: GPL-3.0-or-later
3 #
4 # Run me with:
@@ -16,6 +16,7 @@
16 # --local-files set the full path of the desired tarball to run install with
17 # --allow-duplicate-install do not bail if we detect a duplicate install
18 # --reinstall if an existing install would be updated, reinstall instead
19 +# --disable-telemetry opt out of anonymous statistics
20 # --claim-token specify a token to use for claiming the newly installed instance
21 # --claim-url specify a URL to use for claiming the newly installed isntance
22 # --claim-rooms specify a list of rooms to claim the newly installed instance to
@@ -43,6 +44,10 @@ PACKAGES_SCRIPT="https://raw.githubusercontent.com/netdata/netdata/master/packag
44 # Netdata Tarball Base URL (defaults to our Google Storage Bucket)
45 [ -z "$NETDATA_TARBALL_BASEURL" ] && NETDATA_TARBALL_BASEURL=https://storage.googleapis.com/netdata-nightlies
46
47 +TELEMETRY_URL="https://posthog.netdata.cloud/capture/"
48 +TELEMETRY_API_KEY="${NETDATA_POSTHOG_API_KEY:-mqkwGT0JNFqO-zX2t0mW6Tec9yooaVu7xCBlXtHnt5Y}"
49 +KICKSTART_OPTIONS="${*}"
50 +
51 # ---------------------------------------------------------------------------------------------------------------------
52 # library functions copied from packaging/installer/functions.sh
53
@@ -76,8 +81,93 @@ setup_terminal() {
81 setup_terminal || echo > /dev/null
82
83 # -----------------------------------------------------------------------------
84 +telemetry_event() {
85 + if [ -n "${NETDATA_DISABLE_TELEMETRY}" ]; then
86 + return 0
87 + fi
88 +
89 + if [ -e "/etc/os-release" ]; then
90 + eval "$(grep -E "^(NAME|ID|ID_LIKE|VERSION|VERSION_ID)=" < /etc/os-release | sed 's/^/HOST_/')"
91 + fi
92 +
93 + if [ -z "${HOST_NAME}" ] || [ -z "${HOST_VERSION}" ] || [ -z "${HOST_ID}" ]; then
94 + if [ -f "/etc/lsb-release" ]; then
95 + DISTRIB_ID="unknown"
96 + DISTRIB_RELEASE="unknown"
97 + DISTRIB_CODENAME="unknown"
98 + eval "$(grep -E "^(DISTRIB_ID|DISTRIB_RELEASE|DISTRIB_CODENAME)=" < /etc/lsb-release)"
99 + if [ -z "${HOST_NAME}" ]; then HOST_NAME="${DISTRIB_ID}"; fi
100 + if [ -z "${HOST_VERSION}" ]; then HOST_VERSION="${DISTRIB_RELEASE}"; fi
101 + if [ -z "${HOST_ID}" ]; then HOST_ID="${DISTRIB_CODENAME}"; fi
102 + fi
103 + fi
104 +
105 + KERNEL_NAME="$(uname -s)"
106 +
107 + if [ "${KERNEL_NAME}" = FreeBSD ]; then
108 + TOTAL_RAM="$(sysctl -n hw.physmem)"
109 + elif [ "${KERNEL_NAME}" = Darwin ]; then
110 + TOTAL_RAM="$(sysctl -n hw.memsize)"
111 + elif [ -r /proc/meminfo ]; then
112 + TOTAL_RAM="$(grep -F MemTotal /proc/meminfo | cut -f 2 -d ':' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | cut -f 1 -d ' ')"
113 + TOTAL_RAM="$((TOTAL_RAM * 1024))"
114 + fi
115 +
116 + if [ -f /etc/machine-id ]; then
117 + DISTINCT_ID="$(cat /etc/machine-id)"
118 + elif command -v uuidgen 2> /dev/null; then
119 + DISTINCT_ID="$(uuidgen)"
120 + else
121 + DISTINCT_ID="null"
122 + fi
123 +
124 + REQ_BODY="$(cat << EOF
125 +{
126 + "api_key": "${TELEMETRY_API_KEY}",
127 + "event": "${1}",
128 + "properties": {
129 + "distinct_id": "${DISTINCT_ID}",
130 + "event_source": "agent installer",
131 + "\$current_url": "agent installer",
132 + "\$pathname": "netdata-installer",
133 + "\$host": "installer.netdata.io",
134 + "\$ip": "127.0.0.1",
135 + "script_variant": "legacy-kickstart",
136 + "error_code": "${2}",
137 + "error_message": "${3}",
138 + "install_options": "${KICKSTART_OPTIONS}",
139 + "netdata_release_channel": "${RELEASE_CHANNEL:-null}",
140 + "netdata_install_type": "kickstart-build",
141 + "host_os_name": "${HOST_NAME:-unknown}",
142 + "host_os_id": "${HOST_ID:-unknown}",
143 + "host_os_id_like": "${HOST_ID_LIKE:-unknown}",
144 + "host_os_version": "${HOST_VERSION:-unknown}",
145 + "host_os_version_id": "${HOST_VERSION_ID:-unknown}",
146 + "system_kernel_name": "${KERNEL_NAME}",
147 + "system_kernel_version": "$(uname -r)",
148 + "system_architecture": "$(uname -m)",
149 + "system_total_ram": "${TOTAL_RAM:-unknown}"
150 + }
151 +}
152 +EOF
153 +)"
154 +
155 +if [ -n "$(command -v curl 2> /dev/null)" ]; then
156 + curl --silent -o /dev/null --write-out '%{http_code}' -X POST --max-time 2 --header "Content-Type: application/json" -d "${REQ_BODY}" "${TELEMETRY_URL}"
157 +else
158 + wget -q -O - --no-check-certificate \
159 + --server-response \
160 + --method POST \
161 + --timeout=1 \
162 + --header 'Content-Type: application/json' \
163 + --body-data "${REQ_BODY}" \
164 + "${TELEMETRY_URL}" 2>&1 | awk '/^ HTTP/{print $2}'
165 +fi
166 +}
167 +
168 fatal() {
80 - printf >&2 "${TPUT_BGRED}${TPUT_WHITE}${TPUT_BOLD} ABORTED ${TPUT_RESET} ${*} \n\n"
169 + printf >&2 "${TPUT_BGRED}${TPUT_WHITE}${TPUT_BOLD} ABORTED ${TPUT_RESET} ${1} \n\n"
170 + telemetry_event "INSTALL_FAILED" "${1}" "${2}"
171 exit 1
172 }
173
@@ -142,15 +232,10 @@ run() {
232 return ${ret}
233 }
234
145 -fatal() {
146 - printf >&2 "${TPUT_BGRED}${TPUT_WHITE}${TPUT_BOLD} ABORTED ${TPUT_RESET} ${*} \n\n"
147 - exit 1
148 -}
149 -
235 warning() {
236 printf >&2 "${TPUT_BGRED}${TPUT_WHITE}${TPUT_BOLD} WARNING ${TPUT_RESET} ${*} \n\n"
237 if [ "${INTERACTIVE}" = "0" ]; then
153 - fatal "Stopping due to non-interactive mode. Fix the issue or retry installation in an interactive mode."
238 + fatal "Stopping due to non-interactive mode. Fix the issue or retry installation in an interactive mode." F0001
239 else
240 read -r -p "Press ENTER to attempt netdata installation > "
241 progress "OK, let's give it a try..."
@@ -200,11 +285,11 @@ download() {
285 url="${1}"
286 dest="${2}"
287 if command -v curl > /dev/null 2>&1; then
203 - run curl -q -sSL --connect-timeout 10 --retry 3 --output "${dest}" "${url}"
288 + run curl -q -sSL --connect-timeout 10 --retry 3 --output "${dest}" "${url}" || fatal "Cannot download ${url}" F0002
289 elif command -v wget > /dev/null 2>&1; then
205 - run wget -T 15 -O "${dest}" "${url}" || fatal "Cannot download ${url}"
290 + run wget -T 15 -O "${dest}" "${url}" || fatal "Cannot download ${url}" F0002
291 else
207 - fatal "I need curl or wget to proceed, but neither is available on this system."
292 + fatal "I need curl or wget to proceed, but neither is available on this system." F0003
293 fi
294 }
295
@@ -268,7 +353,7 @@ dependencies() {
353 if [ -f "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" ]; then
354 run cp "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
355 else
271 - fatal "Invalid given dependency file, please check your --local-files parameter options and try again"
356 + fatal "Invalid given dependency file, please check your --local-files parameter options and try again" F1001
357 fi
358 else
359 download "${PACKAGES_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
@@ -296,7 +381,7 @@ safe_sha256sum() {
381 elif command -v shasum > /dev/null 2>&1; then
382 shasum -a 256 "$@"
383 else
299 - fatal "I could not find a suitable checksum binary to use"
384 + fatal "I could not find a suitable checksum binary to use" F0004
385 fi
386 }
387
@@ -374,33 +459,37 @@ while [ -n "${1}" ]; do
459 NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --disable-cloud"
460 NETDATA_DISABLE_CLOUD=1
461 ;;
462 + "--disable-telemetry")
463 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --disable-telemetry"
464 + NETDATA_DISABLE_TELEMETRY=1
465 + ;;
466 "--local-files")
467 if [ -z "${2}" ]; then
379 - fatal "Missing netdata: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
468 + fatal "Missing netdata: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order" F1002
469 fi
470
471 export NETDATA_LOCAL_TARBALL_OVERRIDE="${2}"
472
473 if [ -z "${3}" ]; then
385 - fatal "Missing checksum file: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
474 + fatal "Missing checksum file: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order" F1003
475 fi
476
477 export NETDATA_LOCAL_TARBALL_OVERRIDE_CHECKSUM="${3}"
478
479 if [ -z "${4}" ]; then
391 - fatal "Missing go.d tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
480 + fatal "Missing go.d tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order" F1004
481 fi
482
483 export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN="${4}"
484
485 if [ -z "${5}" ]; then
397 - fatal "Missing go.d config tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
486 + fatal "Missing go.d config tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order" F1005
487 fi
488
489 export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN_CONFIG="${5}"
490
491 if [ -z "${6}" ]; then
403 - fatal "Missing dependencies management scriptlet: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
492 + fatal "Missing dependencies management scriptlet: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order" F1006
493 fi
494
495 export NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT="${6}"
@@ -426,7 +515,7 @@ if [ -n "${NETDATA_DISABLE_CLOUD}" ]; then
515 fi
516 fi
517
429 -# shellcheck disable=SC2235,SC2030
518 +# shellcheck disable=SC2235,SC2030,SC2031
519 if ( [ -z "${NETDATA_CLAIM_TOKEN}" ] && [ -n "${NETDATA_CLAIM_URL}" ] ) || ( [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ -z "${NETDATA_CLAIM_URL}" ] ); then
520 run_failed "Invalid claiming options, both a claiming token and URL must be specified."
521 exit 1
@@ -468,13 +557,11 @@ if [ -n "$ndpath" ] ; then
557 progress "Updated existing install at ${ndpath}"
558 exit 0
559 else
471 - fatal "Failed to update existing Netdata install"
472 - exit 1
560 + fatal "Failed to update existing Netdata install" F0100
561 fi
562 else
563 if [ -z "${NETDATA_ALLOW_DUPLICATE_INSTALL}" ] || [ "${ndstatic}" = "yes" ] ; then
476 - fatal "Existing installation detected which cannot be safely updated by this script, refusing to continue."
477 - exit 1
564 + fatal "Existing installation detected which cannot be safely updated by this script. Refusing to continue." F0101
565 else
566 progress "User explicitly requested duplicate install, proceeding."
567 fi
@@ -483,8 +570,7 @@ if [ -n "$ndpath" ] ; then
570 if [ "${ndstatic}" = "no" ] ; then
571 progress "User requested reinstall instead of update, proceeding."
572 else
486 - fatal "Existing install is a static install, please use kickstart-static64.sh instead."
487 - exit 1
573 + fatal "Existing install is a static install. Please use kickstart-static64.sh instead." F0102
574 fi
575 fi
576 else
@@ -497,8 +583,7 @@ if [ -n "$ndpath" ] ; then
583 claim
584 exit $?
585 elif [ -z "${NETDATA_ALLOW_DUPLICATE_INSTALL}" ] ; then
500 - fatal "Existing installation detected which cannot be safely updated by this script, refusing to continue."
501 - exit 1
586 + fatal "Existing installation detected which cannot be safely updated by this script. Refusing to continue." F0103
587 else
588 progress "User explicitly requested duplicate install, proceeding."
589 fi
@@ -528,18 +613,26 @@ else
613 fi
614
615 if ! grep netdata-latest.tar.gz "${ndtmpdir}/sha256sum.txt" | safe_sha256sum -c - > /dev/null 2>&1; then
531 - fatal "Tarball checksum validation failed. Stopping Netdata Agent installation and leaving tarball in ${ndtmpdir}.\nUsually this is a result of an older copy of the file being cached somewhere upstream and can be resolved by retrying in an hour."
616 + fatal "Tarball checksum validation failed. Stopping Netdata Agent installation and leaving tarball in ${ndtmpdir}.\nUsually this is a result of an older copy of the file being cached somewhere upstream and can be resolved by retrying in an hour." F0005
617 fi
618 run tar -xf netdata-latest.tar.gz
619 rm -rf netdata-latest.tar.gz > /dev/null 2>&1
535 -cd netdata-* || fatal "Cannot cd to netdata source tree"
620 +cd netdata-* || fatal "Cannot cd to netdata source tree" F0006
621
622 # ---------------------------------------------------------------------------------------------------------------------
623 # install netdata from source
624
625 install() {
626 progress "Installing netdata..."
542 - run ${sudo} ./netdata-installer.sh ${NETDATA_UPDATES} ${NETDATA_INSTALLER_OPTIONS} || fatal "netdata-installer.sh exited with error"
627 + run ${sudo} ./netdata-installer.sh ${NETDATA_UPDATES} ${NETDATA_INSTALLER_OPTIONS}
628 + case $? in
629 + 1)
630 + fatal "netdata-installer.sh exited with error" F0007
631 + ;;
632 + 2)
633 + fatal "Insufficient RAM to install netdata" F0008
634 + ;;
635 + esac
636 if [ -d "${ndtmpdir}" ] && [ ! "${ndtmpdir}" = "/" ]; then
637 run ${sudo} rm -rf "${ndtmpdir}" > /dev/null 2>&1
638 fi
@@ -552,7 +645,7 @@ else
645 if [ "$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ] && [ -x "$(find . -mindepth 1 -maxdepth 1 -type d)/netdata-installer.sh" ]; then
646 cd "$(find . -mindepth 1 -maxdepth 1 -type d)" && install "$@"
647 else
555 - fatal "Cannot install netdata from source (the source directory does not include netdata-installer.sh). Leaving all files in ${ndtmpdir}"
648 + fatal "Cannot install netdata from source (the source directory does not include netdata-installer.sh). Leaving all files in ${ndtmpdir}" F0009
649 exit 1
650 fi
651 fi
packaging/installer/methods/kickstart.md
+1 -1
@@ -96,7 +96,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do
96 run the following:
97
98 ```bash
99 -[ "146d9b21dc692e93b3856da92aa46b7e" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
99 +[ "9e33680cf2d6d37233726729836fea9d" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
100 ```
101
102 If the script is valid, this command will return `OK, VALID`.