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

Share:
6,279

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    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
    Roland Pihlakas over 3 years
    I had to run additionally this command to make the error go away: chmod 711 /sys/fs/cgroup/cpu,cpuacct
  • Roland Pihlakas
    Roland Pihlakas over 3 years
    Update: More correct version would be probably chmod 751 /sys/fs/cgroup/cpu,cpuacct since the initial permission of that folder is 750.