On 04/14/14 at 04:23pm, Vivek Goyal wrote:
On Fri, Apr 11, 2014 at 02:10:40PM +0800, WANG Chao wrote:
> On 04/10/14 at 10:05am, Vivek Goyal wrote:
> > On Thu, Apr 10, 2014 at 01:30:48PM +0800, WANG Chao wrote:
> >
> > [..]
> > > > dracut-pre-pivot.service has After= dependency on sysroot.mount.
> > > >
> > > > After=initrd.target initrd-parse-etc.service sysroot.mount
> > > >
> > > > So if sysroot.mount fails, dracut-pre-pivot should still be started?
Are you
> > > > sure that it does not get started if sysroot.mount fails.
> > >
> > > dracut-pre-pivot still gets started because dracut-pre-pivot.service
> > > doesn't "Requires=" sysroot.mount. So no matter if
sysroot.mount fails
> > > or not, as long as it's started, dracut-pre-pivot will run.
> >
> > If dracut-pre-pivot will run even if sysroot.mount fails, why did we
> > introduce "nofail" to begin with. (For non-root targets).
>
> Sorry, I made a mistake here last time.
>
> W/o "nofail", sysroot.mount failure causes initrd-root-fs.target never
> get reached (or active). initrd.target isn't reached because of its
> dependency on initrd-root-fs.target. dracut-pre-pivot.service runs
> "After" initrd.target. So when initrd.target isn't reached,
> dracut-pre-pivot appears like spin itself waiting for initrd.target. And
> that's when a so-called "hang" happens.
This is strange. So there is no error propagation mechanism?
I'm not sure. But I think that's probably because that emergency shell
service is disabled and we hang instead of dropping to shell.
There is no such thing as "error" for targets. Lets say target foo.target
Requires=bar.service. Say, bar.service fails activation. That means
foo.target will *never* be activated.
Yep.
Now if some service say abc.service says After=foo.target, it will hang
for infinite time?
Yep, from what I observed.
I thought if a target can not be reached, then we should proagate that
error upwards.
We disabled emergency shell in the first place. But if we defined our
own error handler service, I think it would be triggered.
Thanks
WANG Chao