Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 682022 - app-admin/cgmanager: adapt default startup options to OpenRC cgroup management
Summary: app-admin/cgmanager: adapt default startup options to OpenRC cgroup management
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2019-03-29 15:39 UTC by Maciej S. Szmigiero
Modified: 2021-02-05 23:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2019-03-29 15:39:39 UTC
app-admin/cgmanager needs to be started with 
"-M name=openrc --allow-autoremove-premounted=all --autoremove-premounted-set-release-agent"
in order to make it fully compatible with how OpenRC manages cgroups.
These options should be added to "command_args" in /etc/init.d/cgmanager.

Rationale for each option:
* "-M name=openrc": "openrc" is the cgroup where OpenRC places its services.
We surely don't want to add user sessions there and generally manage these
cgroups behind OpenRC's back,

* "--autoremove-premounted-set-release-agent": OpenRC premounts all cgroup v1 
controllers at a system startup, but without setting any release agents for them.
That's why cgmanager needs to set its own release agent there so empty cgroups
under these controllers (including these created by cgmanager) don't linger around,

* "--allow-autoremove-premounted=all": actually enables handling of
removal-on-empty requests for these premounted cgroup v1 controllers.

Without these two options above empty cgmanager user sessions don't get removed
correctly.

See also bug 593306 for an old bug caused by missing "-M name=openrc" options
(although this is worked around in newer sys-auth/consolekit versions it is
still a problem if using the more flexible pam_cgm instead of
sys-auth/consolekit's built-in session cgroups support).

I am reporting this "bug" not only as a user of this package but also as
the person who added the above command line options upstream and personally
uses them for 1.5+ year now for per-session cgroup management using pam_cgm.