Assorted kickstart install fixes. (#11342)
* Fix claiming on install when using a non-default install prefix. * Just rely on the dependency script to know if it can handle deps on a system. Instead of blindly assuming it can’t handle dependencies for certain systems.
Austin S. Hemmelgarn committed
Jul 19, 2021 at 10:00 UTC
d785d01ddb106a9931296cd20c9ec7be76911566
2 files changed
+22
-26
packaging/installer/kickstart.sh
+21
-25
@@ -259,36 +259,32 @@ dependencies() {
259
echo "Machine : ${MACHINE}"
260
echo "BASH major version: ${BASH_MAJOR_VERSION}"
261
262
- if [ "${OS}" != "GNU/Linux" ] && [ "${SYSTEM}" != "Linux" ]; then
263
- warning "Cannot detect the packages to be installed on a ${SYSTEM} - ${OS} system."
262
+ bash="$(command -v bash 2> /dev/null)"
263
+ if ! detect_bash4 "${bash}"; then
264
+ warning "Cannot detect packages to be installed in this system, without BASH v4+."
265
else
265
- bash="$(command -v bash 2> /dev/null)"
266
- if ! detect_bash4 "${bash}"; then
267
- warning "Cannot detect packages to be installed in this system, without BASH v4+."
268
- else
269
- progress "Fetching script to detect required packages..."
270
- if [ -n "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" ]; then
271
- if [ -f "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" ]; then
272
- run cp "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
273
- else
274
- fatal "Invalid given dependency file, please check your --local-files parameter options and try again"
275
- fi
266
+ progress "Fetching script to detect required packages..."
267
+ if [ -n "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" ]; then
268
+ if [ -f "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" ]; then
269
+ run cp "${NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
270
else
277
- download "${PACKAGES_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
271
+ fatal "Invalid given dependency file, please check your --local-files parameter options and try again"
272
fi
273
+ else
274
+ download "${PACKAGES_SCRIPT}" "${ndtmpdir}/install-required-packages.sh"
275
+ fi
276
280
- if [ ! -s "${ndtmpdir}/install-required-packages.sh" ]; then
281
- warning "Downloaded dependency installation script is empty."
282
- else
283
- progress "Running downloaded script to detect required packages..."
284
- run ${sudo} "${bash}" "${ndtmpdir}/install-required-packages.sh" ${PACKAGES_INSTALLER_OPTIONS}
285
- # shellcheck disable=SC2181
286
- if [ $? -ne 0 ]; then
287
- warning "It failed to install all the required packages, but installation might still be possible."
288
- fi
277
+ if [ ! -s "${ndtmpdir}/install-required-packages.sh" ]; then
278
+ warning "Downloaded dependency installation script is empty."
279
+ else
280
+ progress "Running downloaded script to detect required packages..."
281
+ run ${sudo} "${bash}" "${ndtmpdir}/install-required-packages.sh" ${PACKAGES_INSTALLER_OPTIONS}
282
+ # shellcheck disable=SC2181
283
+ if [ $? -ne 0 ]; then
284
+ warning "It failed to install all the required packages, but installation might still be possible."
285
fi
290
-
286
fi
287
+
288
fi
289
}
290
@@ -537,7 +533,7 @@ if [ -n "${NETDATA_CLAIM_TOKEN}" ]; then
533
if [ -z "${NETDATA_PREFIX}" ] ; then
534
NETDATA_CLAIM_PATH=/usr/sbin/netdata-claim.sh
535
else
540
- NETDATA_CLAIM_PATH="${NETDATA_PREFIX}/bin/netdata-claim.sh"
536
+ NETDATA_CLAIM_PATH="${NETDATA_PREFIX}/netdata/usr/sbin/netdata-claim.sh"
537
fi
538
539
if "${NETDATA_CLAIM_PATH}" -token=${NETDATA_CLAIM_TOKEN} -rooms=${NETDATA_CLAIM_ROOMS} -url=${NETDATA_CLAIM_URL} ${NETDATA_CLAIM_EXTRA}; then
packaging/installer/methods/kickstart.md
+1
-1
@@ -80,7 +80,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do
80
run the following:
81
82
```bash
83
-[ "271aef84d0bbdabb337571a3963549c7" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
83
+[ "836190944d062c712296846c45b68c94" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
84
```
85
86
If the script is valid, this command will return `OK, VALID`.