-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hack for cgroup v2 to sandbox entrypoints (#1175)
Signed-off-by: Jeev B <[email protected]>
- Loading branch information
Showing
4 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
############################################################################################################### | ||
# DISCLAIMER # | ||
# Copied from https://github.com/moby/moby/blob/ed89041433a031cafc0a0f19cfe573c31688d377/hack/dind#L28-L37 # | ||
# Moby License Apache 2.0: https://github.com/moby/moby/blob/ed89041433a031cafc0a0f19cfe573c31688d377/LICENSE # | ||
############################################################################################################### | ||
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then | ||
# move the processes from the root group to the /init group, | ||
# otherwise writing subtree_control fails with EBUSY. | ||
mkdir -p /sys/fs/cgroup/init | ||
busybox 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -euo pipefail | ||
|
||
# Apply cgroup v2 hack | ||
cgroup-v2-hack.sh | ||
|
||
trap 'pkill -P $$' EXIT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -euo pipefail | ||
|
||
# Apply cgroup v2 hack | ||
cgroup-v2-hack.sh | ||
|
||
trap 'pkill -P $$' EXIT | ||
|
||
|