Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 682022

Summary: app-admin/cgmanager: adapt default startup options to OpenRC cgroup management
Product: Gentoo Linux Reporter: Maciej S. Szmigiero <mail>
Component: Current packagesAssignee: Jason Zaman <perfinion>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: polynomial-c
Priority: Normal Keywords: PMASKED
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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.