Score:0

cgroups v2: cgexec causes "cgroup change of group failed"

us flag

When I try to use cgexec, I get the error message "cgroup change of group failed".

This is how I'm setting up:

CGROUPS_DIR='/sys/fs/cgroup'
createdGroup_dir="$CGROUPS_DIR/createdGroup"

if ! [ -d "$createdGroup_dir" ]; then

    mkdir -p "$createdGroup_dir"/leaf

    echo +cpu +cpuset +io +memory +pids > "$createdGroup_dir"/cgroup.subtree_control

    echo 3G > "$createdGroup_dir"/memory.high
    echo 18G > "$createdGroup_dir"/memory.max

    chown -R user:user "$createdGroup_dir"/leaf
fi

This is how I'm trying to execute (as user):

cgexec -g memory:createdGroup /absolute/path/to/executable

This is what is output:

cgroup change of group failed

I'm using ubuntu 22.04c (c means with 6.1.0-1009-oem kernel. I tried the other options but the result is the same)

I'm using cgroup-tools/jammy,now 2.0-2 which is supposed to support cgroupsv2.

What am I missing?

Thanks in advance for your help!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.