[systemd-devel] Services with multiple pre-requisites

Lennart Poettering lennart at poettering.net
Tue Dec 22 20:43:08 UTC 2020


On Di, 22.12.20 15:24, freedesktop at priatel.co.uk (freedesktop at priatel.co.uk) wrote:
65;6200;1c
> The third.service started as soon as *either* the first.target or
> second.target was started, even though it has *both* of them as Requisites,
> and as previously quoted, the manual,
> https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Requisite
> =, says:
>   | Requisite=
>   |
>   |     Similar to Requires=. However, if the units listed here are not
>   |     started already, they will not be started and the starting of
>   |     this unit will fail immediately.
>
> Bluntly, that does not appear to be true. It is a documentation bug, or at
> least poorly worded.

Bluntly, maybe actually read what the docs say. Exactly one sentence
after the one you quoted you find this:

    Requisite= does not imply an ordering dependency, even if both
    units are started in the same transaction. Hence this setting
    should usually be combined with After=, to ensure this unit is not
    started before the other unit.

> If first.target is started (which has Wants=third.service), but
> second.target is not, then how is it that third.service's
> "Requisite=second.target" does not cause "the starting of third.service to
> fail immediately"?
>
> Following Andrei's suggestion, I changed third.service to:

Maybe just read the docs, more then two sentences.

I mean, the docs certainly can use improvement. Everyhing can. But
humm, the docs don't need "fixing", they aren't broken. They suggest
exactly what to do.

Happy to review/merge a patch that improves things, but I think the
brokeness you two imply is just not there.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list