chris.willing |
02-27-2017 05:01 PM |
libcgroup - supplied rc.cgred broken by erroneous patch
The patch libcgroup.init.diff.gz which is applied when libcgroup package is built is broken. It changes loading of /etc/sysconfig/cgred.conf to loading of $CGRED_CONF which is set to /etc/cgrules.conf. It should instead be loading /etc/cgred.conf which defines various OPTIONS. I guess the confusion is due to there being two configuration files used when rc.cgred is run. The affected part of the patch (right near the top) should really be:
Code:
# Read in configuration options.
-if [ -f "/etc/sysconfig/cgred.conf" ] ; then
- . /etc/sysconfig/cgred.conf
+if [ -f /etc/cgred.conf ] ; then
+ . /etc/cgred.conf
This leads to another configuration issue. When /etc/cgred.conf is now sourced, it defines SOCKET_GROUP="cgred" where cgred is a system group but that group doesn't exist. It could be defined SOCKET_GROUP="" (effectively root group) but it's probably best to have a new system group named cgred. This enables cgexec to be run sgid instead of suid (requires explicit 'chmod 2755 /usr/bin/cgexec' though).
One other related concern is that when "/etc/rc.d/rc.cgconfig stop" is run, it calls /usr/sbin/cgclear. Could this call be made "/usr/sbin/cgclear -l /etc/cgconfig.conf" instead please? Otherwise the whole cgroup file system is removed which is not what is wanted if running "rc.cgconfig restart" because "rc.cgconfig start" assumes that the root of the cgroup filesystem already exists. The cgroup filesystem root is normally created early in rc.S but the plain cgclear removes it (along with anything subsequently added to it) and there's no existing mechanism at the moment to reinstate the root so that "rc.cgconfig start" can add to it.
Thanks,
chris
|