Skip to content

Commit

Permalink
Setup cgroups v2 controllers inside docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
mariash committed Jan 15, 2025
1 parent 98b4175 commit 6483da9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/docker/test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
set -eu
set -o pipefail

if [ -f /sys/fs/cgroup/cgroup.controllers ]; then
echo "Setting up controllers for cgroup v2"
# move the processes from the root group to the /init group,
# otherwise writing subtree_control fails with EBUSY
# An error during moving non-existent process (i.e., "cat") is ignored.
mkdir -p /sys/fs/cgroup/init
xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || :
# enable controllers
sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers > /sys/fs/cgroup/cgroup.subtree_control
fi

. "/ci/shared/helpers/git-helpers.bash"

function test() {
Expand Down

0 comments on commit 6483da9

Please sign in to comment.