Hi all, 
I“ve been looking around quite a bit and found out (various sources) that it seems to be norrmal behaviour for cgroups (which are created by the user) not to survive reboots.
I“ve also found some hints as how to tackle the problem but haven“t had yet the opportunity to dive into the matter.
I“ll look into it as soon as I can. 
As a workaround I think a simple script involving the above commands should work as well.
So whenever cgexec
is needed running the script beforehand should solve the āproblemā. 
Yet there was another thing which bothered me quite a bit:
Following the tutorial provided by the two sources
I noticed the cgexec
-command was invariably executed as root (with sudo
).
Checking the process with top
I saw that (in my example dosbox
) was accordingly running as root.
That“s actually not something I want and after a bit of research I found out that it“s the normal scenario.
A good didcussion can be found here: linux - Does managing cgroups require root access? - Unix & Linux Stack Exchange .
The normal scenario is that you set cgcreate
, cgset
, cgdelete
, cgget
, etc. up as root.
Eventually the program/script meant to be restrained from sucking too many resources will be executed as a normal user.
So, setup as root, use and execution as user.
I tried it out and indeed it works. We need the -a
and -t
parameters with the cgcreate
-command.
From man pages:
-a :
defines the name of the user and the group which own the rest of the defined
control groupās files. These users are allowed to set subsystem parameters and
create subgroups. The default value is the same as has the parent cgroup.
-t :
defines the name of the user and the group, which owns tasks file of the defined
control group. I.e. this user and members of this group have write access to the
file. The default value is the same as has the parent cgroup.
So what I“ve done is the following:
sudo cgcreate -t rosika2:rosika2 -a rosika2:rosika2 -g cpu:cpulimited
sudo cgset -r cpu.shares=512 cpulimited
For creation we still need to be root, but we can execute the command as a normal user now 
cgexec -g cpu:cpulimited dosbox
and top -i
proves that dosbox is actually running as non-root:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1815 rosika2 20 0 472440 75940 13812 R 16,3 7,5 0:02.16 dosbox
Well, together with the script solution mentioned at the beginning I think this could be a good way of working with cgroups . 
Have a nice Sunday all of you ā¦
⦠and many greetings from Rosika 