chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Thu, 28 Jun 2018 07:24:07 +0000 (09:24 +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.

(cherry picked from commit f6c63f6fc90040f0017a7cc37f3a05d5b86226d7)

src/core/cgroup.c

index 313801544010a9f9e64ed55fad37237896a417b5..1dd17d3e7ce7e61c0d1d1c779164b66a2cdcb46b 100644 (file)
@@ -2340,7 +2340,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);
 
 #if 0 /// elogind is not init