diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-11-28 04:53:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-11-28 04:53:29 +0000 |
commit | 17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99 (patch) | |
tree | 3e0c96613972e8bb4afdeeb97a034806363ddfa9 /packaging/installer | |
parent | Releasing debian version 1.18.1-1. (diff) | |
download | netdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.tar.xz netdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.zip |
Merging upstream version 1.19.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer')
-rw-r--r-- | packaging/installer/README.md | 18 | ||||
-rw-r--r-- | packaging/installer/UPDATE.md | 8 | ||||
-rw-r--r-- | packaging/installer/functions.sh | 34 | ||||
-rwxr-xr-x | packaging/installer/kickstart-static64.sh | 12 | ||||
-rwxr-xr-x | packaging/installer/kickstart.sh | 3 |
5 files changed, 44 insertions, 31 deletions
diff --git a/packaging/installer/README.md b/packaging/installer/README.md index eb6d89423..4840d29c1 100644 --- a/packaging/installer/README.md +++ b/packaging/installer/README.md @@ -39,16 +39,15 @@ bash <(curl -Ss https://my-netdata.io/kickstart.sh) !!! note Do not use `sudo` for the one-line installer—it will escalate privileges itself if needed. -``` + To learn more about the pros and cons of using *nightly* vs. *stable* releases, see our [notice about the two options](#nightly-vs-stable-releases). -``` <details markdown="1"><summary>Click here for more information and advanced use of the one-line installation script.</summary> Verify the integrity of the script with this: ```bash -[ "735e9966a4cf0187863e06a5282b34a7" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "0ae8dd3c4c9b976c4342c9fc09d9afae" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` _It should print `OK, VALID` if the script is the one we ship._ @@ -109,7 +108,7 @@ This script installs Netdata at `/opt/netdata`. Verify the integrity of the script with this: ```bash -[ "c529e4eb7ce201845cef605d450f8380" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "8ad43ff960bf6f2487233682909f7a87" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* @@ -127,7 +126,6 @@ Example using all the above parameters: ```sh bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --dont-wait --dont-start-it --no-updates --stable-channel --local-files /tmp/my-selfdownloaded-tarball.tar.gz /tmp/checksums.txt ``` -Note: `--stable-channel` and `--local-files` overlap, if you use the tarball override the stable channel option is not effective If your shell fails to handle the above one liner, do this: @@ -200,13 +198,13 @@ Try our experimental automatic requirements installer (no need to be root). This Install the packages for having a **basic Netdata installation** (system monitoring and many applications, without `mysql` / `mariadb`, `postgres`, `named`, hardware sensors and `SNMP`): ```sh -curl -Ss 'https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh' >/tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata +curl -Ss 'https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata ``` Install all the required packages for **monitoring everything Netdata can monitor**: ```sh -curl -Ss 'https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh' >/tmp/kickstart.sh && bash /tmp/kickstart.sh -i netdata-all +curl -Ss 'https://raw.githubusercontent.com/netdata/netdata-demo-site/master/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata-all ``` If the above do not work for you, please [open a github issue](https://github.com/netdata/netdata/issues/new?title=packages%20installer%20failed&labels=installation%20help&body=The%20experimental%20packages%20installer%20failed.%0A%0AThis%20is%20what%20it%20says:%0A%0A%60%60%60txt%0A%0Aplease%20paste%20your%20screen%20here%0A%0A%60%60%60) with a copy of the message you get on screen. We are trying to make it work everywhere (this is also why the script [reports back](https://github.com/netdata/netdata/issues/2054) success or failure for all its runs). @@ -377,7 +375,7 @@ If you experience an issue with `/usr/bin/install` being absent in pfSense 2.3 o ##### FreeNAS -On FreeNAS-Corral-RELEASE (>=10.0.3), Netdata is pre-installed. +On FreeNAS-Corral-RELEASE (>=10.0.3 and <11.3), Netdata is pre-installed. To use Netdata, the service will need to be enabled and started from the FreeNAS **[CLI](https://github.com/freenas/cli)**. @@ -596,7 +594,11 @@ By default, Netdata's installation scripts enable automatic updates for both nig If you would prefer to manually update your Netdata agent, you can disable automatic updates by using the `--no-updates` option when you install or update Netdata using the [one-line installation script](#one-line-installation). ```bash +# kickstart.sh bash <(curl -Ss https://my-netdata.io/kickstart.sh) --no-updates + +# kickstart-static64.sh +bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --no-updates ``` With automatic updates disabled, you can choose exactly when and how you [update Netdata](UPDATE.md). diff --git a/packaging/installer/UPDATE.md b/packaging/installer/UPDATE.md index 083d8da3f..ab5b558f7 100644 --- a/packaging/installer/UPDATE.md +++ b/packaging/installer/UPDATE.md @@ -29,10 +29,14 @@ Keep in mind, Netdata may now have new features, or certain old features may now ### Manual update to get the latest nightly build -The `kickstart.sh` one-liner will do a one-time update to the latest nightly build, if executed as follows: +The `kickstart.sh` and `kickstart-static64.sh` one-liners will do a one-time update to the latest nightly build, if executed as follows: ```sh +# kickstart.sh bash <(curl -Ss https://my-netdata.io/kickstart.sh) --no-updates + +# kickstart-static64.sh +bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --no-updates ``` ### Auto-update @@ -46,7 +50,7 @@ Note that after Jan 2019, the `kickstart.sh` one-liner `bash <(curl -Ss https:// ## You downloaded a binary package -If you installed it from a binary package, the best way is to **obtain a newer copy** from the source you got it in the first place. This includes the static binary installation via `kickstart-base64.sh`, which would need to be executed again. +If you installed it from a binary package, the best way is to **obtain a newer copy** from the source you got it in the first place. If a newer version of Netdata is not available from the source you got it, we suggest to uninstall the version you have and follow the [installation](README.md) instructions for installing a fresh version of Netdata. diff --git a/packaging/installer/functions.sh b/packaging/installer/functions.sh index 03dd8dc89..d2b7b6761 100644 --- a/packaging/installer/functions.sh +++ b/packaging/installer/functions.sh @@ -728,19 +728,21 @@ safe_sha256sum() { fi } -get_crondir() { - crondir= - [ -d "/etc/periodic/daily" ] && crondir="/etc/periodic/daily" - [ -d "/etc/cron.daily" ] && crondir="/etc/cron.daily" +_get_crondir() { + if [ -d /etc/cron.daily ]; then + echo /etc/cron.daily + elif [ -d /etc/periodic/daily ]; then + echo /etc/periodic/daily + else + echo >&2 "Cannot figure out the cron directory to handle netdata-updater.sh activation/deactivation" + return 1 + fi - echo "${crondir}" + return 0 } -check_crondir_permissions() { - if [ -z "${1}" ]; then - echo >&2 "Cannot figure out the cron directory to handle netdata-updater.sh activation/deactivation" - return 1 - elif [ "${UID}" -ne "0" ]; then +_check_crondir_permissions() { + if [ "${UID}" -ne "0" ]; then # We cant touch cron if we are not running as root echo >&2 "You need to run the installer as root for auto-updating via cron" return 1 @@ -773,8 +775,8 @@ cleanup_old_netdata_updater() { rm -f "${NETDATA_PREFIX}"/usr/libexec/netdata-updater.sh fi - crondir="$(get_crondir)" - check_crondir_permissions "${crondir}" || return 1 + crondir="$(_get_crondir)" || return 1 + _check_crondir_permissions "${crondir}" || return 1 if [ -f "${crondir}/netdata-updater.sh" ]; then echo >&2 "Removing incorrect netdata-updater filename in cron" @@ -785,8 +787,8 @@ cleanup_old_netdata_updater() { } enable_netdata_updater() { - crondir="$(get_crondir)" - check_crondir_permissions "${crondir}" || return 1 + crondir="$(_get_crondir)" || return 1 + _check_crondir_permissions "${crondir}" || return 1 echo >&2 "Adding to cron" @@ -803,8 +805,8 @@ enable_netdata_updater() { } disable_netdata_updater() { - crondir="$(get_crondir)" - check_crondir_permissions "${crondir}" || return 1 + crondir="$(_get_crondir)" || return 1 + _check_crondir_permissions "${crondir}" || return 1 echo >&2 "You chose *NOT* to enable auto-update, removing any links to the updater from cron (it may have happened if you are reinstalling)" echo >&2 diff --git a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh index a988e4f62..72cd00b87 100755 --- a/packaging/installer/kickstart-static64.sh +++ b/packaging/installer/kickstart-static64.sh @@ -183,17 +183,22 @@ fi # --------------------------------------------------------------------------------------------------------------------- opts= -inner_opts= +NETDATA_INSTALLER_OPTIONS="" +NETDATA_UPDATES="--auto-update" RELEASE_CHANNEL="nightly" while [ -n "${1}" ]; do if [ "${1}" = "--dont-wait" ] || [ "${1}" = "--non-interactive" ] || [ "${1}" = "--accept" ]; then opts="${opts} --accept" shift 1 elif [ "${1}" = "--dont-start-it" ]; then - inner_opts="${inner_opts} ${1}" + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}" + shift 1 + elif [ "${1}" = "--no-updates" ]; then + NETDATA_UPDATES="" shift 1 elif [ "${1}" = "--stable-channel" ]; then RELEASE_CHANNEL="stable" + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}" shift 1 elif [ "${1}" = "--local-files" ]; then shift 1 @@ -214,7 +219,6 @@ while [ -n "${1}" ]; do exit 1 fi done -[ -n "${inner_opts}" ] && inner_opts="-- ${inner_opts}" # --------------------------------------------------------------------------------------------------------------------- TMPDIR=$(create_tmp_directory) @@ -238,7 +242,7 @@ fi # --------------------------------------------------------------------------------------------------------------------- progress "Installing netdata" -run ${sudo} sh "${TMPDIR}/netdata-latest.gz.run" ${opts} ${inner_opts} +run ${sudo} sh "${TMPDIR}/netdata-latest.gz.run" ${opts} -- ${NETDATA_UPDATES} ${NETDATA_INSTALLER_OPTIONS} #shellcheck disable=SC2181 if [ $? -eq 0 ]; then diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 1612d5614..c66cff3d2 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -307,6 +307,7 @@ while [ -n "${1}" ]; do shift 1 elif [ "${1}" = "--stable-channel" ]; then RELEASE_CHANNEL="stable" + NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS --stable-channel" shift 1 elif [ "${1}" = "--local-files" ]; then shift 1 @@ -351,7 +352,7 @@ done if [ "${INTERACTIVE}" = "0" ]; then PACKAGES_INSTALLER_OPTIONS="--dont-wait --non-interactive ${PACKAGES_INSTALLER_OPTIONS}" - NETDATA_INSTALLER_OPTIONS="--dont-wait" + NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS --dont-wait" fi TMPDIR=$(create_tmp_directory) |