[systemd-devel] Delegate= on slice before v237

Lennart Poettering lennart at poettering.net
Tue Feb 12 10:17:15 UTC 2019


On Mo, 11.02.19 16:39, Filipe Brandenburger (filbranden at google.com) wrote:

> Hi Lennart,

heya!

> Before systemd v237 (when Delegate= was no longer allowed on slice
> units)... Did setting Delegate=yes on a slice have *any* effect at all?
>
> Or did it just do nothing (and a slice with Delegate=no or no setting
> behave just the same)?
>
> Reason I ask is: I want to scrap this code
> <https://github.com/opencontainers/runc/blob/v1.0.0-rc6/libcontainer/cgroups/systemd/apply_systemd.go#L195>
> in libcontainer that tries to detect whether Delegate= is accepted in a
> slice unit. (I'll just default it to false, never try it.)
>
> I'd like to be able to say that Delegate=yes never really did anything at
> all on slice units... So I'm trying to confirm that is really the case
> before stating it.

So, it wasn't supposed to do anything, and what it does differs on
cgroupsv2 and cgroupsv1. The fact it wasn't refused outright was an
accident, and because it was one I am not entirely sure what the
precise effect of allowing it was. However, I am pretty sure it at
least had two effects:

1. it would turn on all controllers for the cgroup

2. it would stop systemd to ever migrating foreign processes below
   that slice, which is primarily relevant only when changing cgroup
   related props on the slice dynamically I guess.

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list