Skip to content

Commit

Permalink
Use rbind to mount cgroups in case of nested trees
Browse files Browse the repository at this point in the history
  • Loading branch information
3XX0 committed Aug 6, 2021
1 parent 35728b6 commit 9316c1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conf/hooks/10-cgroups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ while IFS=':' read -r x ctrl path; do
fi < /proc/self/mountinfo | { IFS=' ' read -r x x x root mount x || :; }

if [ -n "${root}" ] && [ -n "${mount}" ]; then
printf "%s %s none x-create=dir,bind,nosuid,noexec,nodev,ro\n" "${mount}/${path#${root}}" "${mount}" >> "${ENROOT_MOUNTS}"
printf "%s %s none x-create=dir,rbind,nosuid,noexec,nodev,ro\n" "${mount}/${path#${root}}" "${mount}" >> "${ENROOT_MOUNTS}"
fi
done < /proc/self/cgroup

printf "none /sys/fs/cgroup none bind,remount,nosuid,noexec,nodev,ro,rslave,nofail,silent\n" >> "${ENROOT_MOUNTS}"
printf "none /sys/fs/cgroup none rbind,remount,nosuid,noexec,nodev,ro,rslave,nofail,silent\n" >> "${ENROOT_MOUNTS}"

0 comments on commit 9316c1b

Please sign in to comment.