Skip to content

Commit

Permalink
Add Kdump option to disable reboot after save_core
Browse files Browse the repository at this point in the history
By default, Kdump reboots the system after the crash dump is saved.
While this works in most cases, it does not work for systems hosted in
RAM where the crash dump is lost once rebooted. To support this
scenario, a new option in the kdump.conf, disable_crash_dump_reboot, is
added and set to 0 by default. Setting this option to 1 will disable the
reboot by having the kdumpctl script exit instead.
  • Loading branch information
nangelastro committed Sep 30, 2024
1 parent 1bc0923 commit 0d883bb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
7 changes: 7 additions & 0 deletions SPECS/kexec-tools/kdump.conf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@
# to send fence_kdump notifications to.
# (this option is mandatory to enable fence_kdump).
#
# disable_crash_dump_reboot <0 | 1>
# - Disables the default action to reboot after the crash dump is
# saved. This is particularly useful when the operating system is
# running in RAM and reboots would otherwise remove the crash dump.
# Specify 1 to disable rebooting once the crash dump is saved.
#

#raw /dev/vg/lv_kdump
#ext4 /dev/vg/lv_kdump
Expand All @@ -183,3 +189,4 @@ core_collector makedumpfile -l --message-level 1 -d 31
#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
#fence_kdump_args -p 7410 -f auto -c 0 -i 10
#fence_kdump_nodes node1 node2
#disable_crash_dump_reboot 0
19 changes: 18 additions & 1 deletion SPECS/kexec-tools/kdumpctl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ check_config()
case "$config_opt" in
\#* | "")
;;
raw|ext2|ext3|ext4|minix|btrfs|xfs|nfs|ssh|sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|failure_action|default|final_action|force_rebuild|force_no_rebuild|dracut_args|fence_kdump_args|fence_kdump_nodes)
raw|ext2|ext3|ext4|minix|btrfs|xfs|nfs|ssh|sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|failure_action|default|final_action|force_rebuild|force_no_rebuild|dracut_args|fence_kdump_args|fence_kdump_nodes|disable_crash_dump_reboot)
# remove inline comments after the end of a directive.
[ -z "$config_val" ] && {
echo "Invalid kdump config value for option $config_opt."
Expand Down Expand Up @@ -1249,6 +1249,23 @@ main ()
start)
if [ -s /proc/vmcore ]; then
save_core

local _disable_crash_dump_reboot disable_crash_dump_reboot="0"
_disable_crash_dump_reboot=`grep ^disable_crash_dump_reboot $KDUMP_CONFIG_FILE 2>/dev/null`

if [ $? -eq 0 ]; then
disable_crash_dump_reboot=`echo $_disable_crash_dump_reboot | cut -d' ' -f2`

if [ "$disable_crash_dump_reboot" != "0" ] && [ "$disable_crash_dump_reboot" != "1" ]; then
echo "Error: disable_crash_dump_reboot value is invalid"
return 1
fi
fi

if [ "$disable_crash_dump_reboot" == "1" ]; then
exit 0
fi

reboot
else
start
Expand Down
4 changes: 2 additions & 2 deletions SPECS/kexec-tools/kexec-tools.signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"kdump-lib-initramfs.sh": "ff4b63f99470ee796fd7e4a532dde241c4da02909306926a08a172457775a92a",
"kdump-lib.sh": "3d50507626d4a92b8448c7d6604923f6f460c4cb5c8b18977381a7d5e516dfba",
"kdump-udev-throttler": "125d538a59172f779b40ea32fea1e4eb50d849f25eb2537a48328d4401136679",
"kdump.conf": "c4cd6c4a2f00e7df10d939bc2f35f8b6b8a3edd71245aa3ba0d7fff53d9f42e8",
"kdump.conf": "c1b69d46daa5adc296d3042403c084d780389b18abf00849d6743130220d155f",
"kdump.conf.5": "bab6c7b171f76e8c6df91bb7db852815caacbc3cd3d4309a1dc58d36950440e4",
"kdump.service": "ed8d22fafa6cfafaddcfd9fec82e3fa7fa42aa0366f69676fafa97e200b0506a",
"kdump.sysconfig": "d03a24659c08aa4ce5a8e54edbe64e149f8c572c76c4e338d84dbdfbeab8fb63",
"kdump.sysconfig.aarch64": "a829f3a0f88d983ccec2782b048f12a2eafca71aac4dd42acac2eaea8f7dd8d9",
"kdump.sysconfig.i386": "1175bcc11be49841d4b8c3f9612e68bb7b2e0e8f00067ffa782fd9dba04f821d",
"kdump.sysconfig.x86_64": "850b3be780165d0721edb8d34b2ba28aafc60b29850ff627daf04190369e359c",
"kdumpctl": "34976fa2ca34a455f393d2ac212a628d73ba4113b44f0e819c3cb5b1195e504b",
"kdumpctl": "2d6d70544525cdbdea999307b7a2631c6f9cda51a02225dfb4159bc6a45ce465",
"kdumpctl.8": "025a39d212eed0584da7c23c1bb50d6ab797a0fa3c686ac6b80391af875dbaec",
"kexec-kdump-howto.txt": "e783390a9aa582a2b5e7981cd3277081385340b5873a3f0633c789811876eccb",
"kexec-tools-2.0.27.tar.xz": "38d78bcfa33a88928324b57dc81f50c1dfc279eede45e80957ca18f4e84b8187",
Expand Down
5 changes: 4 additions & 1 deletion SPECS/kexec-tools/kexec-tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Summary: The kexec/kdump userspace component
Name: kexec-tools
Version: 2.0.27
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -330,6 +330,9 @@ done
/usr/share/makedumpfile/

%changelog
* Mon Sep 30 2024 Nicholas Angelastro <[email protected]> - 2.0.27-8
- Add kdump option to disable rebooting after saving crash dump

* Tue Jul 09 2024 Chris Co <[email protected]> - 2.0.27-7
- Remove requires on dhcp-client

Expand Down

0 comments on commit 0d883bb

Please sign in to comment.