[systemd-devel] [PATCH] fstab-generator: local-fs.target waits for nofail mounts
Vivek Goyal
vgoyal at redhat.com
Thu Apr 10 06:46:56 PDT 2014
On Thu, Apr 10, 2014 at 06:38:59AM +0400, Andrey Borzenkov wrote:
[..]
> > So with nofail opion for rootfs we should have following situation.
> >
> > - sysroot.mount
> > Before=initrd-root-fs.target
> > - initrd-root-fs.target
> > Requires=sysroot.mount
> > OnFailure=emergency.target
> > - initrd.target
> > Wants=initrd-root-fs.target
> > OnFailure=emergency.target
> > - dracut-pre-pivot.service
> > After=initrd.target sysroot.mount
> >
> > Now let us say sysroot.mount failed activation because root device did not
> > show up. We waited for certain time interval, then time out. Now what will
> > happen to initrd-root-fs.target and initrd.target states.
> >
>
> Assuming initrd-root-fs.target Requires sysroot.mounts it enters Failed
> state and systemd effectively executes analog of "systemctl start
> emergency.target". What happens after that is defined entirely by what
> emergency.target pulls in.
>
> initrd.target in your example does not depend on sysroot.mount in any
> way so unless there are further indirect dependencies it actually
> should be reached at this point.
initrd.target Wants initrd-root-fs.target which inturn depends on
sysroot.mount. systemd automatically generates a Requires=sysroot.mount
in initrd-root-fs.target.
So if sysroot.mount fails, that should start emergency.target as
initrd-root-fs.target will fail.
As initrd.target has Wants=initrd-root-fs.target, and
initrd-root-fs.target activation has failed. So does that mean that
initrd.target will reach the failed state too and we will try to
launch emergency.target.
What will happen to dracut-pre-pivot.service. It is supposed to run
after intird.target has reached. Now initrd.target has failed activation.
Will dracut-pre-pivot.service be activated?
Thanks
Vivek
More information about the systemd-devel
mailing list