So I'm in the process of setting up CGroups on a few servers, and I'm using the documentation pretty heavily to do this.
I came across this in section 2.8.1 of the Fedora Resource Management Guide (also weirdly in This redhat guide:
The entry now specifies that when the user named maria uses the ftp command, the process is automatically moved to the /usergroup/staff/ftp cgroup in the hierarchy that contains the devices subsystem. Note, however, that the daemon moves the process to the cgroup only after the appropriate condition is fulfilled. Therefore, the ftp process might run for a short time in the wrong group. Furthermore, if the process quickly spawns children while in the wrong group, these children might not be moved.
This is listed as somewhat of a sidenote, but it seems like a pretty major issue that kind of undermines the whole point of cGroups. So before I go any further in setting these up, is there a work around or fix for this? Or am I not approaching this right in my thought process?
Its suggested to use cgexec like this to launch a process in a cgroup:
cgexec -g cpu:group1 lynx http://www.redhat.com
but that seems like it would be kind of hard to implement system wide so that every process was launched like so.
Am I missing something here or is there really no alternative? It also seems like this could be a documentation bug as the fedora guide is using a redhat.com link as the example which makes me think the doc is outdated.
Cheers!
on redhat I used
libcgroup-pam
to move user processes to cgroup,libcgroup-pam
does work for me because it sets the users session process to the cgroup, and then all other processes are children and are defaultly in the cgroups