From: Lennart Poettering Date: Fri, 22 Sep 2017 18:09:21 +0000 (+0200) Subject: socket: assign socket units to a default slice unconditionally X-Git-Tag: v235~66^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6893%2Fhead;p=thirdparty%2Fsystemd.git socket: assign socket units to a default slice unconditionally 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) --- diff --git a/src/core/socket.c b/src/core/socket.c index 9d8367e90bd..5993ce0d002 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -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;