summaryrefslogtreecommitdiffstats
path: root/netdata-installer.sh
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2024-06-13 23:20:09 +0300
committerGitHub <noreply@github.com>2024-06-13 23:20:09 +0300
commitaf11bfa7dc8ef75360754ac6ae680b2f31116c63 (patch)
tree921978b450c057b96a9aa39cba9505e5587b810d /netdata-installer.sh
parentface336da751406b269cf391674fa6bf1fecbdc4 (diff)
fix detect_libc in installer (#17880)
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-xnetdata-installer.sh54
1 files changed, 27 insertions, 27 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh
index 9452c1e729..dc24832932 100755
--- a/netdata-installer.sh
+++ b/netdata-installer.sh
@@ -583,6 +583,33 @@ build_fluentbit() {
cd - > /dev/null || return 1
}
+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
+ cmd=$(ldd /bin/sh | 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
+
+ if [ -z "$libc" ]; then
+ warning "Cannot detect a supported libc on your system, eBPF support will be disabled."
+ return 1
+ fi
+
+ echo "${libc}"
+}
+
bundle_fluentbit() {
progress "Prepare Fluent-Bit"
@@ -1055,33 +1082,6 @@ fi
[ -n "${GITHUB_ACTIONS}" ] && echo "::endgroup::"
-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
- cmd=$(ldd /bin/sh | 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
-
- if [ -z "$libc" ]; then
- warning "Cannot detect a supported libc on your system, eBPF support will be disabled."
- return 1
- fi
-
- echo "${libc}"
-}
-
should_install_fluentbit() {
if [ "$(uname -s)" = "Darwin" ]; then
return 1