[systemd-devel] Still confused with socket activation

Lennart Poettering lennart at poettering.net
Tue Feb 2 21:04:38 UTC 2021


On Di, 02.02.21 22:50, Andrei Borzenkov (arvidjaar at gmail.com) wrote:

> 02.02.2021 17:59, Lennart Poettering пишет:
> >
> > Note that Requires= in almost all cases should be combined with an
> > order dep of After= onto the same unit.
>
> Years ago I asked for example when Requires makes sense without After.
> Care to show it? I assume you must have use case if you say "in almost all".

You can synthesize cases where it doesn't matter: if you know the
order is enforced by other means already, for example transitive
ordering. i.e. think of a late-boot service that needs some early-boot
preparation service to have run. Because the early-boot service
probably ordered itself before sysinit.target, and the late-boot
service is implicitly ordered after basic.target, there isn' a need to
order them directly against each other too, the transient deps between
sysinit.target and basic.target already gurantee correct ordering.

And there are other cases: for example if the ordering is already
configured the other way, or if you have any other reason you know the
stuff is ordered already.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list