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?
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.
Now if some service say abc.service says After=foo.target, it will hang
for infinite time?
I thought if a target can not be reached, then we should proagate that
error upwards.
Thanks
Vivek