From: Lennart Poettering Date: Tue, 20 Nov 2018 18:45:09 +0000 (+0100) Subject: cgroup: only install cgroup release agent when we own the root cgroup X-Git-Tag: v240~225^2~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0c339ed4b16cc00b3176ae63cd6b863763a4a79;p=thirdparty%2Fsystemd.git cgroup: only install cgroup release agent when we own the root cgroup If we run in a container we shouldn't patch around this, and most likely we can't anyway, and there's not much point in complaining about this. Hence let's strictly say: the agent is private property of the host's system instance, nothing else. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 815fca28cc2..4ce6c9f6f47 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2372,7 +2372,7 @@ int manager_setup_cgroup(Manager *m) { (void) sd_event_source_set_description(m->cgroup_inotify_event_source, "cgroup-inotify"); - } else if (MANAGER_IS_SYSTEM(m) && !MANAGER_IS_TEST_RUN(m)) { + } else if (MANAGER_IS_SYSTEM(m) && manager_owns_root_cgroup(m) && !MANAGER_IS_TEST_RUN(m)) { /* On the legacy hierarchy we only get notifications via cgroup agents. (Which isn't really reliable, * since it does not generate events when control groups with children run empty. */