SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
View Poll Results: I
don't use cgroups.
15
93.75%
use cgroups by configuring them manually, and keep /etc/rc.d/rc.cgconfig -x.
0
0%
configure cgroups via /etc/cgroups.conf and let them get configured by /etc/rc.d/rc.cgconfig.
0
0%
have my own way of doing everything. (I.e. installed systemd, or use cgroups v2, or something else.)
I am a bit confused about how cgroups are configured in Slackware.
In rc.S, there are two places where things are done with cgroups:
/etc/rc.d/rc.S
**** Mounts the v1 controllers at lines 51-74
**** Starts cgmanager/cgproxy at lines 375-378
**** Starts libcgroup services at lines 380-384
libcgroup's /etc/cgconfig.conf file permits a mount{ } option, which allows to specify mounts in the config file and manipulate them in runtime (more or less ;-)).
What is the purpose of the lines 51-74 then?
So far I have only found that manual part can parse /proc/cgroups , but those are only v1 controllers, so I'd still think that using the libcgroup interface would be more flexible (and liberating for the main initialization script).
I mean, there is plenty literature regarding how cgroups help managing resources between competing containers. But why are all these cgroup controllers mounted by default in Slackware, in rc.S?
Couldn't they be mounted in some rc.d/rc.cgroup script that could be set executable, like other rc scripts, by people actually using them?
Or are they actually always used by default, (independently of any container) by something I don't know?
Last edited by philanc; 06-03-2019 at 05:40 PM.
Reason: typo
I mean, there is plenty literature regarding how cgroups help managing resources between competing containers. But why are all these cgroup controllers mounted by default in Slackware, in rc.S?
Couldn't they be mounted in some rc.d/rc.cgroup script that could be set executable, like other rc scripts, by people actually using them?
Or are they actually always used by default, (independently of any container) by something I don't know?
If you read the document I posted a link to, you may find some more usages for them, besides containers.
But I don't think they are used by anything in a fresh Slackware installation.
I think this ut why are all these cgroup controllers mounted by default in Slackware, in rc.S?
Couldn't they be mounted in some rc.d/rc.cgroup script that could be set executable, like other rc scripts...
Personally, I don't like the idea of splitting more stuff out of rc.S.
There are already examples like rc.loop whose existence is IMO completely unnecessary. Separate rc.* for daemons (services) that need to be stopped/started by admins is perfectly reasonable, but I'm not a fan of splitting out other stuff. I'd much rather see a rc.conf/rc.conf.local mechanism added in order to allow people to configure the behaviour of the main rc scripts without having to hack on them.
If you read the document I posted a link to, you may find some more usages for them, besides containers.
I read your 'Reading-cgroups-manual' document. Very insightful.
Quote:
But I don't think they are used by anything in a fresh Slackware installation.
Yes, this was my core question. I wonder if they are used by some "desktop" stuff I don't know and don't use (polkit, consolekit, others?) -- maybe like you suggest in your document?
Personally, I don't like the idea of splitting more stuff out of rc.S.
There are already examples like rc.loop whose existence is IMO completely unnecessary. Separate rc.* for daemons (services) that need to be stopped/started by admins is perfectly reasonable, but I'm not a fan of splitting out other stuff. I'd much rather see a rc.conf/rc.conf.local mechanism added in order to allow people to configure the behaviour of the main rc scripts without having to hack on them.
Agreed. My main point wasn't to specifically put the cgroup controllers mounting stuff in a rc.d script and only there.
I see in rc.S many optional functions started only some /etc file is there (eg. LVM), or if some rc.d script is executable (eg. FUSE). I was wondering if mounting cgroups controllers was optional or not.
In case it is optional, I think it could be controlled in a similar way (could be an executable rc.d script, some /etc conf file, or as you suggest, in a global rc.conf file.
I hope people routinely using cgroups will contribute to the thread and just tell us what they use them for.
While, indeed /etc/cgconfig.conf should be loaded by default, as the man page says, there is another default source of configuration which needs to be loaded:
Code:
/etc/cgconfig.d/*.conf
The man pages 'man cgconfigparser' and 'man cgconfig.conf' say it like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.