[systemd-devel] Requires and After

Olaf van der Spek ml at vdspek.org
Wed Jan 2 08:53:36 UTC 2019


On Wed, Jan 2, 2019 at 9:14 AM Michael Chapman <mike at very.puzzling.org> wrote:
> > What good is an activation dependency without an ordering dependency?
>
> The problem is that it's not necessarily clear _which_ ordering dependency
> is required. systemd can't just assume one way or the other.
>

> I have two services on my system, A.service and B.service, where A.service
> Wants=B.service but is ordered Before=B.service. The reason for this is
> that when I start A I want B to be automatically started too, but B cannot
> function without A being active.

And A can't function without B being active? So basically a circular dependency?

> So here's an example where the activation dependency is essentially
> "opposite" that of the ordering dependency.

Not entirely, as I assume B Wants A too.

> As you've pointed out, Requires= a bit of a strange case. If I change the
> above situation to use Requires= instead, and if B subsequently exits or
> fails, A would be stopped. I don't have an immediate use for that, but I
> think it's a bit presumptuous to assume that no use could possibly exist.
>
> I think there's use in having Wants= and Requires= work similarly to each
> other,

I agree

> in that they are both orthogonal to ordering dependencies.

I don't agree ;)

> It would
> be odd to have only one imply an ordering dependency.
>
> Moreover, we can't simply change what systemd does here: it would be a
> backward-incompatible change. We don't want that.

It's 2019.. I'm sure we can improve without that being a showstopper.

-- 
Olaf


More information about the systemd-devel mailing list