Fixes NetData installer on *BSD systems post libmosquitto / eBPF (#8121)
* Fixed bad usage of mktemp with mixed -t/-d options * Fixed bad copy/pasta of wrong grep ./packaging/*.checksums to generate sha256sums.txt for libmosquitto * Disabled bundling/building of custom libmosquitto fork on *BSD systems (for now) as it is broken * Skip trying to install eBPF Collector Package(s) on non-Linux systems * Update netdata-installer.sh Co-Authored-By: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com> Co-authored-by: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com>
James Mills committed
Feb 19, 2020 at 01:11 UTC
3e970168ad2ede15079b70dbab97031f5b362261
1 file changed
+21
-11
netdata-installer.sh
+21
-11
@@ -456,11 +456,17 @@ bundle_libmosquitto() {
456
return 0
457
fi
458
459
+ if [ "$(uname)" != "Linux" ]; then
460
+ echo >&2 " Sorry NetData with custom libmosquitto is unsupported on $(uname) at this time!"
461
+ echo >&2 " Please contact NetData suppoort! https://github.com/netdata/netdata/issues/new"
462
+ return 0
463
+ fi
464
+
465
progress "Prepare custom libmosquitto version"
466
467
MOSQUITTO_PACKAGE_VERSION="$(cat packaging/mosquitto.version)"
468
463
- tmp=$(mktemp -t -d netdata-mosquitto-XXXXXX)
469
+ tmp="$(mktemp -d -t netdata-mosquitto-XXXXXX)"
470
MOSQUITTO_PACKAGE_BASENAME="${MOSQUITTO_PACKAGE_VERSION}.tar.gz"
471
472
if [ -z "${NETDATA_LOCAL_TARBALL_OVERRIDE_MOSQUITTO}" ]; then
@@ -475,9 +481,7 @@ bundle_libmosquitto() {
481
return 0
482
fi
483
478
- grep "${MOSQUITTO_PACKAGE_BASENAME}\$" "${INSTALLER_DIR}/packaging/go.d.checksums" > "${tmp}/sha256sums.txt" 2> /dev/null
479
-
480
- cp packaging/mosquitto.checksums "${tmp}/sha256sums.txt"
484
+ grep "${MOSQUITTO_PACKAGE_BASENAME}\$" "${INSTALLER_DIR}/packaging/mosquitto.checksums" > "${tmp}/sha256sums.txt" 2> /dev/null
485
486
# Checksum validation
487
if ! (cd "${tmp}" && safe_sha256sum -c "sha256sums.txt"); then
@@ -861,10 +865,10 @@ if [ "${UID}" -eq 0 ]; then
865
run chmod 4750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ioping"
866
fi
867
864
- if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin" ]; then
865
- run chown root:${NETDATA_GROUP} "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin"
866
- run chmod 4750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin"
867
- fi
868
+ if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin" ]; then
869
+ run chown root:${NETDATA_GROUP} "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin"
870
+ run chmod 4750 "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/ebpf_process.plugin"
871
+ fi
872
873
if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network" ]; then
874
run chown "root:${NETDATA_GROUP}" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/cgroup-network"
@@ -975,7 +979,7 @@ install_go() {
979
break
980
fi
981
done
978
- tmp=$(mktemp -t -d netdata-go-XXXXXX)
982
+ tmp="$(mktemp -d -t netdata-go-XXXXXX)"
983
GO_PACKAGE_BASENAME="go.d.plugin-${GO_PACKAGE_VERSION}.${OS}-${ARCH}.tar.gz"
984
985
if [ -z "${NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN}" ]; then
@@ -1092,6 +1096,12 @@ should_install_ebpf() {
1096
return 1
1097
fi
1098
1099
+ if [ "$(uname)" != "Linux" ]; then
1100
+ echo >&2 " Sorry eBPF Collector is currently unsupproted on $(uname) Systems at this time."
1101
+ echo >&2 " Please contact NetData suppoort! https://github.com/netdata/netdata/issues/new"
1102
+ return 1
1103
+ fi
1104
+
1105
# Get and Parse Kernel Version
1106
kver="$(get_kernel_version)"
1107
kver="${kver:-0}"
@@ -1105,7 +1115,7 @@ should_install_ebpf() {
1115
1116
# Check Kernel Config
1117
1108
- tmp="$(mktemp -t -d netdata-ebpf-XXXXXX)"
1118
+ tmp="$(mktemp -d -t netdata-ebpf-XXXXXX)"
1119
1120
echo >&2 " Downloading check-kernel-config.sh ..."
1121
if ! get "https://raw.githubusercontent.com/netdata/kernel-collector/master/tools/check-kernel-config.sh" > "${tmp}"/check-kernel-config.sh; then
@@ -1158,7 +1168,7 @@ install_ebpf() {
1168
return 1
1169
fi
1170
1161
- tmp="$(mktemp -t -d netdata-ebpf-XXXXXX)"
1171
+ tmp="$(mktemp -d -t netdata-ebpf-XXXXXX)"
1172
1173
echo >&2 " Downloading eBPF Package ${PACKAGE_TARBALL_URL} ..."
1174
if ! get "${PACKAGE_TARBALL_URL}" > "${tmp}"/"${PACKAGE_TARBALL}"; then