21.7. 使用 failure_action 参数
failure_action
参数指定在内核崩溃时转储失败时要执行的操作。failure_action
的默认操作是 reboot
,这会重启系统。
failure_action
指定执行以下操作之一:
-
reboot
:在转储失败后重启系统。 -
dump_to_rootfs
:配置了非 root 转储目标时,将转储文件保存在 root 文件系统中。 -
halt
:停止系统。 -
poweroff
:停止系统中的运行操作。 -
shell
:在initramfs
中启动 shell 会话,从中可以手动执行其他恢复操作。
流程:
要将操作配置为在转储失败时执行的操作,请编辑
/etc/kdump.conf
文件并指定其中一个failure_action
选项:# failure_action <reboot | halt | poweroff | shell | dump_to_rootfs>
重启
kdump
服务以使更改生效:# kdumpctl restart