On Thu, 2021-02-04 at 13:07 +0100, Reindl Harald wrote:
> Am 04.02.21 um 12:46 schrieb Benjamin Berg:
> > On Wed, 2021-02-03 at 16:43 +0100, Reindl Harald wrote:
> > > seriously - explain what you expect to happen in case of
> > > 
> > > Requires=a.service
> > > Before=a.service
> > > 
> > > except some warning that it's nonsense
> > 
> > So, one way I used it is as ExecStartPost= equivalent for a .target
> > unit. i.e. pull in a Type=oneshot service once a target has become
> > active in order to execute a simple command
> 
> "Requires=a.service" combined with "Before=a.service" is
> contradictory - 
> don't you get that?

Your statements will not become more informed by repeating them.

It looks to me like you are interpreting Requires= incorrectly. Of
course, one can see a contradiction in saying "B requires A in order to
run" and then also saying "start A after B is ready".

But systemd considers requirements and ordering as two independent
problems. As such "Requires=A" only means something like "unit A must
be added to the transaction together with B". A statement that does not
imply ordering.

Yes, this is a a very logical/mathematical meaning which may not be
what you intuitively expect. And it does have the unfortunate side
effect of sometimes confusing people and they forget to add a needed
After= that they thought was implied.

But, it is well defined what happens when combining Requires= with
Before=. There is no contradiction.

Benjamin

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to