-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
BUG: pam_cgroup simply doesn't work with cgroup2 #84
Comments
Thanks for the bug report, @0n-s. The pam module hasn't been a priority for the current users of libcgroup, so we have not emphasized development or testing in this area. I'm uncertain how much the libcgroup/pam module is being used, as this is the first issue reported against it even though v2.0 has been out 7+ month. Hmmmm.... |
I'm going to assign this to v2.0.1. I'm not certain if it will be fixed in that release, but I would like us to make a decision on how to proceed with pam by that release. Thanks again for the report! |
The pam module is a great thing to have. Cgrulesengd is a hack anyway. I think the Slackware community has seen similar problems with cgroupv1 (and had to rely on cgrulesengd), but sometimes people are just too lazy or shy to report bugs :(. |
Won't argue with the cgrules comment :)
That's good to know. Thank you. |
Services using pam_cgroup.so plugin, asks to match a rule, in the cached list of rules already constructed from /etc/cgrules.conf. This works well with active cgrulesengd but in the instances where its disabled, the rules are not read and cached by default. Fix, this is by reloading and caching the rules, when called with CGFLAG_USECACHE flag. Fixes: libcgroup#84 Reported-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
pam_cgroup.so plugin uses /etc/cgrules.conf to assign processes to the requested cgroup. This works well with active cgrulesengd but in the instances where cgrulesengd is disabled, the rules are not read and cached by default. Fix this is by reloading and caching the rules when called with CGFLAG_USECACHE flag. Fixes: #84 Reported-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> TJH: Minor commit comment changes (cherry picked from commit 80a0bd4)
Thanks for the comments, @0n-s and @lockywolf. I have merged a fix into I'm hoping to get out another release of the 2.0 branch in the next month or so. This fix will obviously be in it. Thanks again! |
pam_cgroup, at least under a cgroup2-only environment (maybe cgroup1 as well, I haven't tested), simply doesn't seem to work at all. It still acts as if it succeeded.
Tracing a random sshd instance for every file it opens, there are only 3:
(nothing else cgroup or libcgroup-related)
For whatever reason cgrules.conf is never loaded. Despite this, it claims it changed the cgroup successfully (with
debug
flag):This is not true, as we can see from the just logged in session:
This failure also doesn't result in the login failing, even though in my PAM configuration pam_cgroup is not optional but required.
(tested with libcgroup v2.0)
The text was updated successfully, but these errors were encountered: