utils: move the cgroup if root on cgroupv2

if we are running on cgroupv2, force the creation of a sub-cgroup even
when we are at the root for the cgroup v2 unified mount.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2022-06-30 14:34:18 +02:00
parent 3426d56b92
commit 5c39797624
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ func moveUnderCgroup(cgroup, subtree string, processes []uint32) error {
}
// root cgroup, skip it
if parts[2] == "/" {
if parts[2] == "/" && !(unifiedMode && parts[1] == "") {
continue
}