File tree Expand file tree Collapse file tree
stemcell_builder/stages/bosh_monit/assets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,21 +19,21 @@ monit_isolation_classid=2958295041
1919#
2020# Prefer cgroup.controllers; also accept stat(2) filesystem type for hosts where
2121# the file is missing from the mount view but the root is still cgroup2fs.
22- monit_using_unified_cgroup_v2 () {
22+ system_using_unified_cgroup_v2 () {
2323 [ -f /sys/fs/cgroup/cgroup.controllers ] && return 0
2424 [ " $( stat -fc %T /sys/fs/cgroup 2> /dev/null) " = " cgroup2fs" ]
2525}
2626
2727permit_monit_access () {
28- if monit_using_unified_cgroup_v2 ; then
28+ if system_using_unified_cgroup_v2 ; then
2929 # cgroupv2 (unified hierarchy)
3030 # Create a sub-cgroup under the current process's cgroup and move into it.
3131 # The iptables rules match on this cgroup path.
3232 cgroup_mount=" $( awk ' $1 == "cgroup2" && $3 == "cgroup2" { print $2 }' /proc/self/mounts) "
3333 nb_matching_cgroup_mounts=$( echo " $cgroup_mount " | wc -l)
3434 current_cgroup=" $( grep ' ^0::' /proc/self/cgroup | cut -d: -f3) "
3535 if [ -z " ${cgroup_mount} " ] || [ " ${nb_matching_cgroup_mounts} " -ne 1 ] || [ -z " ${current_cgroup} " ]; then
36- echo " permit_monit_access: unable to resolve cgroup v2 mount or path" >&2
36+ echo " permit_monit_access: unable to resolve cgroup v2 mount or path. current_cgroup= ${current_cgroup} cgroup_mount= ${cgroup_mount} " >&2
3737 return 1
3838 fi
3939 monit_access_cgroup=" ${cgroup_mount}${current_cgroup} /monit-api-access"
You can’t perform that action at this time.
0 commit comments