]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: move payload to sub-cgroup first, then sync cgroup trees
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Mar 2019 17:57:53 +0000 (18:57 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 Mar 2019 10:26:17 +0000 (11:26 +0100)
if we sync the legacy and unified trees before moving to the right
subcgroup then ultimately the cgroup paths in the hierarchies will be
out-of-sync... Hence, let's move the payload first, and sync then.

Addresses: https://github.com/systemd/systemd/pull/9762#issuecomment-441187979

src/nspawn/nspawn.c

index 5cb049e5f734fe4ac6dd2e32405388182976f93a..64a30a5b9a800bce23932b4488fcae1b949fc998 100644 (file)
@@ -3962,11 +3962,11 @@ static int run(int master,
         } else if (arg_slice || arg_property)
                 log_notice("Machine and scope registration turned off, --slice= and --property= settings will have no effect.");
 
-        r = sync_cgroup(*pid, arg_unified_cgroup_hierarchy, arg_uid_shift);
+        r = create_subcgroup(*pid, arg_keep_unit, arg_unified_cgroup_hierarchy);
         if (r < 0)
                 return r;
 
-        r = create_subcgroup(*pid, arg_keep_unit, arg_unified_cgroup_hierarchy);
+        r = sync_cgroup(*pid, arg_unified_cgroup_hierarchy, arg_uid_shift);
         if (r < 0)
                 return r;