[systemd-devel] Help regarding service dependency

Amit Saha asaha at redhat.com
Mon Mar 24 20:56:04 PDT 2014



----- Original Message -----
> From: "Andrey Borzenkov" <arvidjaar at gmail.com>
> To: "Amit Saha" <asaha at redhat.com>
> Cc: "systemd Mailing List" <systemd-devel at lists.freedesktop.org>
> Sent: Friday, March 14, 2014 7:08:28 PM
> Subject: Re: [systemd-devel] Help regarding service dependency
> 
> On Fri, Mar 14, 2014 at 11:30 AM, Amit Saha <asaha at redhat.com> wrote:
> >
> >
> > ----- Original Message -----
> >> From: "Andrey Borzenkov" <arvidjaar at gmail.com>
> >> To: "Amit Saha" <asaha at redhat.com>
> >> Cc: "systemd Mailing List" <systemd-devel at lists.freedesktop.org>
> >> Sent: Friday, March 14, 2014 12:35:44 PM
> >> Subject: Re: [systemd-devel] Help regarding service dependency
> >>
> >> В Thu, 13 Mar 2014 21:25:34 -0400 (EDT)
> >> Amit Saha <asaha at redhat.com> пишет:
> >>
> >> > Hello,
> >> >
> >> > We have service1 which starts in default.target, and we want it to start
> >> > After service2
> >> > (systemd-readahead-done) which starts after the default.target is
> >> > reached.
> >> > So, I think what would happen in this case is the After=service2 for
> >> > service1 is ignored
> >> > and it is started before service2 since the default.target must be
> >> > reached.
> >> >
> >>
> >> There is no ordering dependencies between default.target and individual
> >> units; default.target is simply a way to define what is started using
> >> Wants. So it should work.
> >
> 
> My apologies; I tend to miss implicit dependencies. So yes, by default
> if default.target Wants some unit it will be also ordered After this
> unit.
> 
> > Thanks for your reply.
> >
> > I am not sure I follow you when you say "there is no ordering dependency
> > between
> > default.target and individual units". Let's say default.target.wants/
> > have N services. What happens when you have a service, service2 whose
> > unit file has After=default.target in it?  When does it start?
> >
> 
> By default this creates a loop and systemd will need to break it; it
> hopefully will ignore After=default.target.
> 
> But your unit definition in initial post had
> DefaultDependencies=false. In this case I expect that no implicit
> Before=default.target will be added. Did you test it?

Thanks Andrey for you reply. I got a little confused and side tracked,
so I couldn't try your suggestion. Lennart's reply cleared the confusion
and I got it working.

Best,
Amit.






More information about the systemd-devel mailing list