[systemd-devel] unable to attach pid to service delegated directory in unified mode after restart

Lennart Poettering lennart at poettering.net
Thu Mar 3 17:11:03 UTC 2022


On Mo, 21.02.22 22:16, Felip Moll (lipixx at gmail.com) wrote:

> Silvio,
>
> As I commented in my previous post, creating every single job in a separate
> slice is an overhead I cannot assume.
> An HTC system could run thousands of jobs per second, and doing extra
> fork+execs plus waiting for systemd to fill up its internal structures and
> manage it all is a no-no.

Firing an async D-Bus packet to systemd should be hardly measurable.

But note that you can also run your main service as a service, and
then allocate a *single* scope unit for *all* your payloads. That way
you can restart your main service unit independently of the scope
unit, but you only have to issue a single request once for allocating
the scope, and not for each of your payloads.

But that too means you have to issue a bus call. If you really don't
like talking to systemd this is not going to work of course, but quite
frankly, that's a problem you are making yourself, and I am not
particularly sympathetic to it.

> One other option that I am thinking about is extending the parameters of a
> unit file, for example adding a DelegateCgroupLeaf=yes option.
>
> DelegateCgroupLeaf=<yes|no>. If set to yes an extra directory will be
> created into the unit cgroup to place the newly spawned service process.
> This is useful for services which need to be restarted while its forked
> pids remain in the cgroup and the service cgroup is not a leaf
> anymore.

No. Let's not add that.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list