[systemd-devel] Requires and After

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Jan 2 08:27:53 UTC 2019


On Sun, Dec 30, 2018 at 12:05:46PM +0100, Olaf van der Spek wrote:
> Hi,
> 
> Evverx suggested I ask here @ https://github.com/systemd/systemd/issues/11284
> It's about Requires and After. I think a unit in Requires should imply
> that unit in After too, otherwise the requirement isn't really met.
> Is there a use case for Requires but not After?
> If not, would it make sense to change semantics to have Requires imply After?

The short answer is that Requires without After is mostly meaningless,
because it's impossible for systemd to actually implement the check,
so effectively Requires downgrades to Wants.

Two considerations though:
- For Wants=, it is OK to not have an ordering dependency.

  So if we made Requires= imply After=, there'd be an inconsistency
  between Requires= and Wants=.

- When .requires/ is used (and .wants/ too), an After= dependency is
  added automatically.

I think we could consider making Requires= imply After=, with the
necessary notices in NEWS, if somebody looks through units (e.g. all
the ones packaged in Fedora), to verify that this is unlikely to break
existing units. Elsewhere in the thread, somebody mentioned openstack,
so that'd be first thing to check.

Zbyszek


More information about the systemd-devel mailing list