diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2021-03-18 13:39:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 13:39:30 +0000 |
commit | 3b5a69c2a29817f4fe114c09107f7e57e5a4d26d (patch) | |
tree | 8384d5d2aad9a4e4c9bb43aacee69b3501724a74 /netdata-installer.sh | |
parent | 7143244adeb8d00cb9dff8526e887213b83cc359 (diff) |
eBPF plugin
Change eBPF plugin internal organization.
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-x | netdata-installer.sh | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 6ff3c5af04..1040ef576b 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -1617,11 +1617,23 @@ remove_old_ebpf() { # Added to remove eBPF programs with name pattern: NAME_VERSION.SUBVERSION.PATCH if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/pnetdata_ebpf_process.3.10.0.o" ]; then - echo >&2 "Removing old eBPF programs" + echo >&2 "Removing old eBPF programs with patch." rm -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/rnetdata_ebpf"*.?.*.*.o rm -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/pnetdata_ebpf"*.?.*.*.o fi + # Remove old eBPF program to store new eBPF program inside subdirectory + if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/pnetdata_ebpf_process.3.10.o" ]; then + echo >&2 "Removing old eBPF programs installed in old directory." + rm -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/rnetdata_ebpf"*.?.*.o + rm -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/pnetdata_ebpf"*.?.*.o + fi + + # Remove old reject list from previous directory + if [ -f "${NETDATA_PREFIX}/usr/lib/netdata/conf.d/ebpf_kernel_reject_list.txt" ]; then + echo >&2 "Removing old ebpf_kernel_reject_list.txt." + rm -f "${NETDATA_PREFIX}/usr/lib/netdata/conf.d/ebpf_kernel_reject_list.txt" + fi } install_ebpf() { @@ -1658,7 +1670,16 @@ install_ebpf() { # chown everything to root:netdata before we start copying out of our package run chown -R root:netdata "${tmp}" - run cp -a -v "${tmp}"/*netdata_ebpf_*.o "${NETDATA_PREFIX}"/usr/libexec/netdata/plugins.d + if [ ! -d "${NETDATA_PREFIX}"/usr/libexec/netdata/plugins.d/ebpf.d ]; then + mkdir "${NETDATA_PREFIX}"/usr/libexec/netdata/plugins.d/ebpf.d + RET=$? + if [ "${RET}" != "0" ]; then + rm -rf "${tmp}" + return 1 + fi + fi + + run cp -a -v "${tmp}"/*netdata_ebpf_*.o "${NETDATA_PREFIX}"/usr/libexec/netdata/plugins.d/ebpf.d rm -rf "${tmp}" |