[systemd-devel] Crash instead of emergency mode when mount failure

Yang Lyu yang.lyu at axis.com
Fri Jan 18 12:00:07 UTC 2019


Hi,


I have two questions about entering emergency mode when mount target fails.


If local-fs.target fails in booting stage, it will come into emergency mode and wait for user interaction. In this failure case, is it better to introduce a crash generate core dump and reboot automatically?

Replacing emergency mode by such a method can be useful when local-fs.target's failure is transient or user interaction is not convenient.

A possible crash service may like this:

[Unit]
DefaultDependencies=no
Description=Crash the system using the SysRq trigger
[Service]
ExecStartPre=-/bin/sh -c 'echo "crash-system.service started" > /dev/kmsg'
ExecStart=/bin/sh -c 'echo c > /proc/sysrq-trigger'
Type=oneshot

And this new service(instead of current emergency.target) is used in OnFailure of local-fs.target.

Does this sound good and useful? Or what is the drawback of this solution?


Another question is: is there a configuration option to cause a reboot if local-fs.target fails? So that we can use the option directly.


Thank you in advance.


Best regards,

Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190118/823c4684/attachment.html>


More information about the systemd-devel mailing list