Cgroups error: cgroup change of group failed
6,279
Specifying users and groups works fine when you create a subsystem.
sudo cgcreate -t $USER:$USER -a $USER:$USER -g cpu:testgroupcpu
"cgroup change of group failed" error with cgexec from libcgroup
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I'm trying to test cgroup and, after I set it, I stumbled upon that error. That's what I did:
- creation of the group grp
- creation of the user test within the grp group
I ran the command:
sudo cgcreate -t test:grp -a sleax -g memory,cpu:grp echo '10000000'> /sys/fs/cgroup/memory/grp/memory.limit_in_bytes
Then i went to try that with the user test:
test@sleax-PC:~$ cgexec stress -t 20 -c 99 -i 99 cgroup change of group failed
And that's the error I get. Why? I set
-t test:grp
so test is able to write the PIDs. -
Roland Pihlakas over 3 yearsI had to run additionally this command to make the error go away:
chmod 711 /sys/fs/cgroup/cpu,cpuacct
-
Roland Pihlakas over 3 yearsUpdate: More correct version would be probably
chmod 751 /sys/fs/cgroup/cpu,cpuacct
since the initial permission of that folder is750
.