[systemd-devel] Requires and After

Michael Chapman mike at very.puzzling.org
Wed Jan 2 09:20:02 UTC 2019


On Wed, 2 Jan 2019, Jérémy Rosen wrote:
> 
> 
> On 02/01/2019 10:08, Michael Chapman wrote:
> >
> >> Requires = Wants + Requisite + PartOf
> >>
> >> is that correct ?
> > I think it's just:
> >
> >    Requires = Wants + PartOf
> >
> > Wants= propagates "start" and "restart" jobs as "start" jobs on the other
> > unit.
> >
> > ConsistsOf= (the inverse of PartOf=) propagates "stop" and "restart" jobs
> > as "stop" and "try-restart" jobs respectively on the other unit.
> >
> > So Wants= configures activation dependencies in one direction, and
> > PartOf= configures deactivation dependencies in the other direction.
> >
> > (I'm taking this from transaction_add_job_and_dependencies in
> > src/core/transaction.c, if anybody wants to check my working.)
> So...
> 
> Requires = Wants + PartOf
> Requires + After = Wants  + PartOf + Requisite + After
> 
> better ?
> My goal is to try to clarify that in the documentation at some point...

I don't think Requisite= comes into it at all.

Requisite= propagates a "start" or "restart" job as a "verify-active" job. 
In other words, it only checks that the other unit is active, failing the 
activation of the current unit if necessary.

Requires= propagates these as "start" jobs, activating the other unit if 
it is not already active.


More information about the systemd-devel mailing list