]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
socket: assign socket units to a default slice unconditionally 6893/head
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 18:09:21 +0000 (20:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 18:09:21 +0000 (20:09 +0200)
Due to the chown() logic socket units might end up with processes even
if no explicit command is defined for them, hence let's make sure these
processes are in the right cgroup, and that means within a slice.

Mount, swap and service units unconditionally are assigned to a slice
already, let's do the same here, too.

(This becomes more important as soon as the ebpf/firewall stuff is
merged, as there'll be another reason to fork off processes then)

src/core/socket.c

index 9d8367e90bdd070907ca93b105e4e92007231904..5993ce0d0028bb39edf8ab91cb81fe1e7d0c3bbd 100644 (file)
@@ -397,12 +397,12 @@ static int socket_add_extras(Socket *s) {
                 r = unit_add_exec_dependencies(u, &s->exec_context);
                 if (r < 0)
                         return r;
-
-                r = unit_set_default_slice(u);
-                if (r < 0)
-                        return r;
         }
 
+        r = unit_set_default_slice(u);
+        if (r < 0)
+                return r;
+
         r = socket_add_default_dependencies(s);
         if (r < 0)
                 return r;