On Wed, 2021-02-03 at 20:47 +0300, Andrei Borzenkov wrote: > 03.02.2021 00:25, Benjamin Berg пишет: > > On Tue, 2021-02-02 at 22:50 +0300, Andrei Borzenkov 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". > > > > In the GNOME systemd units there are a few places where a Requires= > > is > > combined with Before=. > > > > This is functionally completely equivalent to simply using > Wants+Before. > At least as long as you rely on *documented* functions. Requires= actually has the difference that the unit must become part of the transaction (if it is not active already). So you get a hard failure and appropriate logging if the unit cannot be added to the transaction for some reason. > Care to show more complete example and explain why Wants does not > work in this case? Wants= would work fine. I think it boils down to whether you find the extra assertions useful. The Requires= documentation actually suggests using Wants= exactly to avoid this. Benjamin
Attachment:
signature.asc
Description: This is a digitally signed message part
_______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel