Skip to content

When rootless runc exits, failed to remove cgroupv2 with sub-cgroup #3225

@chenk008

Description

@chenk008

In case of rootless, cgroup2 mount into container /sys/fs/cgroup. After I created sub-cgroup test, and then exited. A error message shown

ERRO[0029] remove /sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/user.slice/runc-foo.scope: device or resource busy

Reproduce:

runc spec --rootless
// add cgroupfs mount into config.json
{
      "destination": "/sys/fs/cgroup",
      "type": "cgroup",
      "source": "cgroup",
      "options": [
        "nosuid",
        "noexec",
        "nodev",
        "relatime"
      ]
}
runc --systemd-cgroup run foo
// in the container
mkdir /sys/fs/cgroup/test
exit

systemd version: 239 (239-41.el8_3)
kernel version: 4.18.0-305.12.1.el8_4.x86_64
linux distro: centos 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions