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!