On Thu, Apr 10, 2014 at 01:30:48PM +0800, WANG Chao wrote:
> dracut-pre-pivot.service has After= dependency on
> 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).
I don't see any Requires= dependencies in dracut-pre-pivit.service.
Everything is Wants= and there are some ordering directieves with After=.
That means even if file system mounting failed, dracut-pre-pivot should
run. That means kdump should get control.
If that's the case, why did we introduce "nofail" and why do we think
that removing "nofail" will hang if failure happens.
Given the fact that currently emergency shell does not do anything in
second kernel, I think kdump should still run even if failure happens. Can
we test it.
Given the current situation, I think even without "nofail", kdump.sh
should be reached. If that's the case, we don't have a problem at all?
> I think we will have to keep our default actions simple and minimal. Boot
> path is complicated and now dracut and systemd control it completely. We
> will not have too much of flexibility w.r.t error handling.
I think it's a good idea directly jumping to our kdump.sh. We can extend
current kdump.sh. Do some reasonable checking, if the error is trivial
and dump target is ready, then we dump. Otherwise do default action.
What do you think?
Yep. Either we can create a seaparate kdump handler or service
(kdump-error-handler.service) and that service can take care of calling
kdump.sh or hook this into emergency handler and force it to call
kdump-error-handler.sh which in turn can call kdump.sh.
So how about starting simple. Can you write a patch where emergency shell
first checks if kdump error handler is present and calls it (instead of
returning and not doing anything). If that works, we can just post a
dracut patch and we will not need anything from systemd?