cgroup-network-helper doesn't work on Proxmox 6 (#7037)
Found that cgroup path does not contain 'emulator' subdirectory. - add a check for 'emulator' subdirectory - make 'c' variable contains full cgroup-path with 'cgroup.procs' filename
Valery Kartel committed
Oct 30, 2019 at 12:48 UTC
e0814afa045cbc888bcd5e0d7709d6d7d8edef63
1 file changed
+5
-3
collectors/cgroups.plugin/cgroup-network-helper.sh
+5
-3
@@ -122,18 +122,20 @@ proc_pid_fdinfo_iff() {
122
123
find_tun_tap_interfaces_for_cgroup() {
124
local c="${1}" # the cgroup path
125
+ [ -d "${c}/emulator" ] && c="${c}/emulator" # check for 'emulator' subdirectory
126
+ c="${c}/cgroup.procs" # make full path
127
128
# for each pid of the cgroup
129
# find any tun/tap devices linked to the pid
128
- if [ -f "${c}/emulator/cgroup.procs" ]
130
+ if [ -f "${c}" ]
131
then
132
local p
131
- for p in $(< "${c}/emulator/cgroup.procs" )
133
+ for p in $(< "${c}" )
134
do
135
proc_pid_fdinfo_iff "${p}"
136
done
137
else
136
- debug "Cannot find file '${c}/emulator/cgroup.procs', not searching for tun/tap interfaces."
138
+ debug "Cannot find file '${c}', not searching for tun/tap interfaces."
139
fi
140
}
141