On Thu, May 08, 2014 at 08:30:19PM +0800, WANG Chao wrote:
[..]
Because when emergency.service is triggered, all the other services
are
stopped running, even the mounted filesystem is umounted.
This is strange. Why already mounted filesysems should be unmounted. I
think we should send a mail to systemd and ask about this behavior.
But I've figured a way to bring /sysroot back to life before
dump_to_rootfs by manually:
systemctl start initqueue
systemctl start sysroot.mount
I am not convinced with this idea of trying to call back into systemd
to start some units after failure. This sounds little fragile to me.
Having said that, it might not be perfect solution but if it works, it
might not be too bad a solution till we find even better solution.
Do we really have to kick initqueue again? Just starging sysroot.mount
is not enough?
Also after starting sysroot.mount, how long will you wait for root to
be mounted?
How are you inducing failure to invoke this error path?
I'm not sure if I'm supposed to do. But it seems to be the best chance
to make root fs available and mounted.
I think here one fundamental problem is that we are not propagating
the failure status upwards if a target fails to reach. If we can look
into that and talk to systemd folks that how about failing all the
services which are waiting on a particular target and we know that
that target has failed to reach. (It could be done at same time
when OnFailure= for target is called).
IOW, I was thinking how about making kdump dump saving code a service
and make that service "Requires" relevant services and targets. And
if any of the service or target fails, kdump service failure routine
should be invoked. I think that probably will require changes in systemd
and is a long term solution.
I think in short term we should be able to live with following.
- Fix systemd to not unmount already mounted file sysmtems as kdump
error handler requires that.
- Drop into kdump through emergency shell and check if root is mounted
and save dump to root (in dump_to_rootfs) case, otherwise reboot.
Thanks
Vivek