diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-04-24 10:05:04 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-04-27 12:18:32 +0200 |
commit | 18c1e481b60395fe0a4b0487462f0e6ed27baa65 (patch) | |
tree | a9d20599aba90fcf8ae94783cbd274c5b48ff453 /src/core/execute.c | |
parent | core: add DelegateSubgroup= setting (diff) | |
download | systemd-18c1e481b60395fe0a4b0487462f0e6ed27baa65.tar.xz systemd-18c1e481b60395fe0a4b0487462f0e6ed27baa65.zip |
execute: don't apply journal + oomd xattrs to subcgroup
We don't need to apply the journal/oomd xattrs to the subcgroups we add,
since those daemons already look for the xattrs up the tree anyway.
Hence remove this.
This is in particular relevant as it means later changes to the xattr
don#t need to be replicated on the subcgroup either.
Diffstat (limited to 'src/core/execute.c')
-rw-r--r-- | src/core/execute.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index da7a37c187..a9e6f7bcae 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -5663,15 +5663,13 @@ int exec_spawn(Unit *unit, r = exec_parameters_get_cgroup_path(params, cgroup_context, &subcgroup_path); if (r < 0) return log_unit_error_errno(unit, r, "Failed to acquire subcgroup path: %m"); - if (r > 0) { /* We are using a child cgroup */ + if (r > 0) { + /* If there's a subcgroup, then let's create it here now (the main cgroup was already + * realized by the unit logic) */ + r = cg_create(SYSTEMD_CGROUP_CONTROLLER, subcgroup_path); if (r < 0) return log_unit_error_errno(unit, r, "Failed to create subcgroup '%s': %m", subcgroup_path); - - /* Normally we would not propagate the xattrs to children but since we created this - * sub-cgroup internally we should do it. */ - cgroup_oomd_xattr_apply(unit, subcgroup_path); - cgroup_log_xattr_apply(unit, subcgroup_path); } } |