Unverified Commit 0f1caf26 by Stéphane Graber Committed by GitHub

Merge pull request #3708 from brauner/2021-03-17/fixes

cgroups: ignore unused controllers
parents f6276497 6159413b
...@@ -2363,9 +2363,17 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, ...@@ -2363,9 +2363,17 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops,
} }
path = lxc_cmd_get_cgroup_path(name, lxcpath, h->controllers[0]); path = lxc_cmd_get_cgroup_path(name, lxcpath, h->controllers[0]);
/* not running */ if (!path) {
if (!path) /*
return false; * Someone might have created a name=<controller>
* controller after the container has started and so
* the container doesn't make use of this controller.
*
* Link: https://github.com/lxc/lxd/issues/8577
*/
TRACE("Skipping unused %s controller", maybe_empty(h->controllers[0]));
continue;
}
fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs"); fullpath = build_full_cgpath_from_monitorpath(h, path, "cgroup.procs");
ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666); ret = lxc_write_to_file(fullpath, pidstr, len, false, 0666);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment