diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-22 20:09:21 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-22 20:09:21 +0200 |
commit | 88af31f92221aac652fe5584093abb0e68bc544a (patch) | |
tree | 1b10fd5edbfffca2ccc2e859528d7e60a0939422 /src | |
parent | cgroup: make use of unit_cgroup_delegate() where useful (diff) | |
download | systemd-88af31f92221aac652fe5584093abb0e68bc544a.tar.xz systemd-88af31f92221aac652fe5584093abb0e68bc544a.zip |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 9d8367e90b..5993ce0d00 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; |