From 88af31f92221aac652fe5584093abb0e68bc544a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 22 Sep 2017 20:09:21 +0200 Subject: [PATCH] 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) --- src/core/socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.47.3