mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
runc exec: use CLONE_INTO_CGROUP when available
It makes sense to make runc exec benefit from clone2(CLONE_INTO_CGROUP), if it is available. Since it requires a recent kernel and might not work, implement a fallback to older way of joining the cgroup. Based on: - https://go-review.googlesource.com/c/go/+/417695 - https://github.com/coreos/go-systemd/pull/458 - https://github.com/opencontainers/cgroups/pull/26 - https://github.com/opencontainers/runc/pull/4822 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -282,7 +282,7 @@ function check_exec_debug() {
|
||||
# Check we can't join non-existing subcgroup.
|
||||
runc exec --cgroup nonexistent test_busybox cat /proc/self/cgroup
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *" adding pid "*"o such file or directory"* ]]
|
||||
[[ "$output" == *" cgroup"*"o such file or directory"* ]]
|
||||
|
||||
# Check we can join top-level cgroup (implicit).
|
||||
runc exec test_busybox grep '^0::/$' /proc/self/cgroup
|
||||
|
||||
Reference in New Issue
Block a user