]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgmanager: have cgm_set and cgm_get use absolute path when possible
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 26 Jun 2014 21:44:46 +0000 (16:44 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 30 Jun 2014 16:42:24 +0000 (12:42 -0400)
commitfb6c761621909d546756821188adf4e6cc3f4944
treec769ca1fece06f12a4f0981a3c85b818e55c83da
parent96324abb7234c5c825b8df022de9f2c92e88c20c
cgmanager: have cgm_set and cgm_get use absolute path when possible

This allows users to get/set cgroup settings when logged into a different
session than that from which they started the container.

There is no cgmanager command to do an _abs variant of cgmanager_get_value
and cgmanager_set_value.  So we fork off a new task, which enters the
parent cgroup of the started container, then can get/set the value from
there.  The reason not to go straight into the container's cgroup is that
if we are freezing the container, or the container is already frozen, we'll
freeze as well :)  The reason to fork off a new task is that if we are
in a cgroup which is set to remove-on-empty, we may not be able to return
to our original cgroup after making the change.

This should fix https://github.com/lxc/lxc/issues/246

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgmanager.c