From: Evgeny Vereshchagin Date: Tue, 3 Apr 2018 13:04:22 +0000 (+0300) Subject: core: skip the removal of cgroups in the TEST_RUN_MINIMAL mode (#8622) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bedc76bafeb76445e5a2228a56ef661d9203bf79;p=elogind.git core: skip the removal of cgroups in the TEST_RUN_MINIMAL mode (#8622) When `systemd` is run in the TEST_RUN_MINIMAL mode, it doesn't really set up cgroups, so it shouldn't try to remove anything. Closes https://github.com/systemd/systemd/issues/8474. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 7b9e29b6f..429d4ca38 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -2340,7 +2340,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) { #if 0 /// elogind is not init /* We can't really delete the group, since we are in it. But * let's trim it. */ - if (delete && m->cgroup_root) + if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL) (void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false); m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source);