15.7. 使用 failure_action 参数

failure_action 参数指定在内核崩溃时转储失败时要执行的操作。failure_action 的默认操作是 reboot,这会重启系统。

参数接受以下要执行的操作:

reboot
转储失败后重启系统。
dump_to_rootfs
当配置了非 root 转储目标时,将转储文件保存在 root 文件系统上。
halt
关闭系统。
poweroff
停止系统上正在运行的操作。
shell
initramfs 中启动 shell 会话,您可以从中手动执行其他恢复操作。

流程:

  1. 要将操作配置为在转储失败时执行的操作,请编辑 /etc/kdump.conf 文件并指定其中一个 failure_action 选项:

    • failure_action reboot
    • failure_action halt
    • failure_action poweroff
    • failure_action shell
    • failure_action dump_to_rootfs
  2. 重启 kdump 服务,以使更改生效。

    # kdumpctl restart