Fix handling of plugin ownership in static builds. (#15230)
* Fix handling of plugin ownership in static builds. * Address review feedback. * Update packaging/makeself/install-or-update.sh --------- Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Austin S. Hemmelgarn committed
Jun 22, 2023 at 07:26 UTC
8b384e402b5cffb295d56eb85ed6d0bfbc826bb2
1 file changed
+11
-2
packaging/makeself/install-or-update.sh
+11
-2
@@ -164,10 +164,21 @@ run chmod g+rx,o+rx /opt
164
run find /opt/netdata -type d -exec chmod go+rx '{}' \+
165
run chown -R ${NETDATA_USER}:${NETDATA_GROUP} /opt/netdata/var
166
167
+if [ -d /opt/netdata/usr/libexec/netdata/plugins.d/ebpf.d ]; then
168
+ run chown -R root:${NETDATA_GROUP} /opt/netdata/usr/libexec/netdata/plugins.d/ebpf.d
169
+fi
170
+
171
# -----------------------------------------------------------------------------
172
173
progress "changing plugins ownership and permissions"
174
175
+for x in apps.plugin perf.plugin slabinfo.plugin debugfs.plugin freeipmi.plugin ioping cgroup-network ebpf.plugin nfacct.plugin xenstat.plugin python.d.plugin charts.d.plugin go.d.plugin ioping.plugin cgroup-network-helper.sh; do
176
+ f="usr/libexec/netdata/plugins.d/${x}"
177
+ if [ -f "${f}" ]; then
178
+ run chown root:${NETDATA_GROUP} "${f}"
179
+ fi
180
+done
181
+
182
if command -v setcap >/dev/null 2>&1; then
183
run setcap "cap_dac_read_search,cap_sys_ptrace=ep" "usr/libexec/netdata/plugins.d/apps.plugin"
184
run setcap "cap_dac_read_search=ep" "usr/libexec/netdata/plugins.d/slabinfo.plugin"
@@ -183,7 +194,6 @@ if command -v setcap >/dev/null 2>&1; then
194
else
195
for x in apps.plugin perf.plugin slabinfo.plugin debugfs.plugin; do
196
f="usr/libexec/netdata/plugins.d/${x}"
186
- run chown root:${NETDATA_GROUP} "${f}"
197
run chmod 4750 "${f}"
198
done
199
fi
@@ -192,7 +202,6 @@ for x in freeipmi.plugin ioping cgroup-network ebpf.plugin nfacct.plugin xenstat
202
f="usr/libexec/netdata/plugins.d/${x}"
203
204
if [ -f "${f}" ]; then
195
- run chown root:${NETDATA_GROUP} "${f}"
205
run chmod 4750 "${f}"
206
fi
207
done