]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: skip the removal of cgroups in the TEST_RUN_MINIMAL mode (#8622)
authorEvgeny Vereshchagin <evvers@ya.ru>
Tue, 3 Apr 2018 13:04:22 +0000 (16:04 +0300)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Apr 2018 13:04:22 +0000 (15:04 +0200)
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.

src/core/cgroup.c

index 62a3d86ef16a975e9cef7445f103c999bc92f89b..87545a28ae943dff84e25e4eab9432b44d38b363 100644 (file)
@@ -2305,7 +2305,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
 
         /* 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);