[cgmanager-devel] [lxc/cgmanager] a6f76b: Fix various operations on controllers assigned to ...

0 views
Skip to first unread message

GitHub

unread,
Feb 28, 2018, 11:16:46 AM2/28/18
to cgmanag...@lists.linuxcontainers.org
Branch: refs/heads/master
Home: https://github.com/lxc/cgmanager
Commit: a6f76bfb5eee260be4491b1021a3406bc2903c2f
https://github.com/lxc/cgmanager/commit/a6f76bfb5eee260be4491b1021a3406bc2903c2f
Author: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>
Date: 2018-01-29 (Mon, 29 Jan 2018)

Changed paths:
M cgmanager.c
M frontend.h
M fs.c
M fs.h

Log Message:
-----------
Fix various operations on controllers assigned to the unified hierarchy

Many operations supported by cgmanager had issues or didn't work at all on
controllers that were assigned to the unified (v2) hierarchy.

Most of the required fixes were simple, but "remove on empty" operation
needed a completely different implementation for cgroups v2 since they do
not support a child cgroup release notification agent, we need to watch for
modification of "cgroup.events" file in the particular cgroup via inotify
instead.
Unfortunately, we can't use libnih built-in inotify watcher for this since
it does not support watching for an IN_MODIFY event.

Signed-off-by: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>


Commit: 15b6c8c954cb68b377289448b0ad68a5e68fd75d
https://github.com/lxc/cgmanager/commit/15b6c8c954cb68b377289448b0ad68a5e68fd75d
Author: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>
Date: 2018-01-29 (Mon, 29 Jan 2018)

Changed paths:
M cgmanager.c
M fs.c
M fs.h

Log Message:
-----------
Add an ability to allow autoremove on pre-mounted v1 controllers

Some init systems (for example OpenRC) mount v1 controllers on boot to be
able to put their services under them but do not set any release agent on
these mounts.
If such controller is then used with cgmanager the autoremove (or
remove-on-empty) functionality will not work for this controller.

This means that when, for example, per-user-session cgroups are created
under such controller, too, empty cgroups from past sessions will litter
the system.

It is safe to allow autoremove and use our release agent for such
pre-mounted controllers, as long as we enable it (via "notify_on_release")
only on particular (sub-)cgroups that we had received an autoremove request
for.

Add two new options to cgmanager to possibly allow just that (they default
to "disabled" setting for backwards compatibility).

Signed-off-by: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>


Commit: 4b51b2109135b9485db2c824502b117885df1026
https://github.com/lxc/cgmanager/commit/4b51b2109135b9485db2c824502b117885df1026
Author: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>
Date: 2018-01-29 (Mon, 29 Jan 2018)

Changed paths:
M .travis.yml
M Makefile.am
M configure.ac
M pam/cgmanager.c
M pam/cgmanager.h
M pam/pam_cgm.c

Log Message:
-----------
Make the PAM_CGM module more configurable

This commit cleans up the PAM_CGM module and makes it much more
configurable.

First, the module is rewritten to keep its data using a PAM module internal
data mechanism instead of using a set of static variables since PAM API
allows doing multiple transactions in parallel, including utilizing the
same module, as long as each one uses a separate transaction handle.

Additionally, a PAM man page for pam_set_data() specifically says that
"[i]n general such files [PAM modules] should not contain static
variables".

Second, the following configuration options are added:
* A pattern setting, which allows naming cgroups created by this module
in a different way from "user/foo/0",

* An ability to disable appending of an index suffix to a pattern-derived
cgroup name,

* A limit setting which allows controlling how large these suffix indices
(if they aren't disabled by the previous option) are allowed to grow,

* An ability to have particular values set in the created final cgroups,

* A setting controlling how deep cgroups prune process goes at the session
close time.

All these options (and their behavior) are described at the top of the
pam_cgm.c file, where there was already a description of the module
operation.

Unfortunately, we cannot use libnih option parsing since it does not work
in a shared library context so in order not to reinvent the wheel the
popular popt library was used instead.

The default values of all these options were set in a way so not to result
in any change of the module behavior, unless specifically configured in a
different way by an user, for compatibility with existing deployments.

Signed-off-by: Maciej S. Szmigiero <ma...@maciej.szmigiero.name>


Commit: b9685abdfdbb0fc1381d6ebb5507a14e29235f70
https://github.com/lxc/cgmanager/commit/b9685abdfdbb0fc1381d6ebb5507a14e29235f70
Author: Serge Hallyn <se...@hallyn.com>
Date: 2018-02-28 (Wed, 28 Feb 2018)

Changed paths:
M .travis.yml
M Makefile.am
M cgmanager.c
M configure.ac
M frontend.h
M fs.c
M fs.h
M pam/cgmanager.c
M pam/cgmanager.h
M pam/pam_cgm.c

Log Message:
-----------
Merge pull request #36 from maciejsszmigiero/fixes-and-improvements

Fixes and improvements


Compare: https://github.com/lxc/cgmanager/compare/8f599b54c802...b9685abdfdbb

Reply all
Reply to author
Forward
0 new messages