Skip to content

Commit 0d883bb

Browse files
committed
Add Kdump option to disable reboot after save_core
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.
1 parent 1bc0923 commit 0d883bb

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

SPECS/kexec-tools/kdump.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@
162162
# to send fence_kdump notifications to.
163163
# (this option is mandatory to enable fence_kdump).
164164
#
165+
# disable_crash_dump_reboot <0 | 1>
166+
# - Disables the default action to reboot after the crash dump is
167+
# saved. This is particularly useful when the operating system is
168+
# running in RAM and reboots would otherwise remove the crash dump.
169+
# Specify 1 to disable rebooting once the crash dump is saved.
170+
#
165171

166172
#raw /dev/vg/lv_kdump
167173
#ext4 /dev/vg/lv_kdump
@@ -183,3 +189,4 @@ core_collector makedumpfile -l --message-level 1 -d 31
183189
#dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
184190
#fence_kdump_args -p 7410 -f auto -c 0 -i 10
185191
#fence_kdump_nodes node1 node2
192+
#disable_crash_dump_reboot 0

SPECS/kexec-tools/kdumpctl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ check_config()
243243
case "$config_opt" in
244244
\#* | "")
245245
;;
246-
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)
246+
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)
247247
# remove inline comments after the end of a directive.
248248
[ -z "$config_val" ] && {
249249
echo "Invalid kdump config value for option $config_opt."
@@ -1249,6 +1249,23 @@ main ()
12491249
start)
12501250
if [ -s /proc/vmcore ]; then
12511251
save_core
1252+
1253+
local _disable_crash_dump_reboot disable_crash_dump_reboot="0"
1254+
_disable_crash_dump_reboot=`grep ^disable_crash_dump_reboot $KDUMP_CONFIG_FILE 2>/dev/null`
1255+
1256+
if [ $? -eq 0 ]; then
1257+
disable_crash_dump_reboot=`echo $_disable_crash_dump_reboot | cut -d' ' -f2`
1258+
1259+
if [ "$disable_crash_dump_reboot" != "0" ] && [ "$disable_crash_dump_reboot" != "1" ]; then
1260+
echo "Error: disable_crash_dump_reboot value is invalid"
1261+
return 1
1262+
fi
1263+
fi
1264+
1265+
if [ "$disable_crash_dump_reboot" == "1" ]; then
1266+
exit 0
1267+
fi
1268+
12521269
reboot
12531270
else
12541271
start

SPECS/kexec-tools/kexec-tools.signatures.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"kdump-lib-initramfs.sh": "ff4b63f99470ee796fd7e4a532dde241c4da02909306926a08a172457775a92a",
2121
"kdump-lib.sh": "3d50507626d4a92b8448c7d6604923f6f460c4cb5c8b18977381a7d5e516dfba",
2222
"kdump-udev-throttler": "125d538a59172f779b40ea32fea1e4eb50d849f25eb2537a48328d4401136679",
23-
"kdump.conf": "c4cd6c4a2f00e7df10d939bc2f35f8b6b8a3edd71245aa3ba0d7fff53d9f42e8",
23+
"kdump.conf": "c1b69d46daa5adc296d3042403c084d780389b18abf00849d6743130220d155f",
2424
"kdump.conf.5": "bab6c7b171f76e8c6df91bb7db852815caacbc3cd3d4309a1dc58d36950440e4",
2525
"kdump.service": "ed8d22fafa6cfafaddcfd9fec82e3fa7fa42aa0366f69676fafa97e200b0506a",
2626
"kdump.sysconfig": "d03a24659c08aa4ce5a8e54edbe64e149f8c572c76c4e338d84dbdfbeab8fb63",
2727
"kdump.sysconfig.aarch64": "a829f3a0f88d983ccec2782b048f12a2eafca71aac4dd42acac2eaea8f7dd8d9",
2828
"kdump.sysconfig.i386": "1175bcc11be49841d4b8c3f9612e68bb7b2e0e8f00067ffa782fd9dba04f821d",
2929
"kdump.sysconfig.x86_64": "850b3be780165d0721edb8d34b2ba28aafc60b29850ff627daf04190369e359c",
30-
"kdumpctl": "34976fa2ca34a455f393d2ac212a628d73ba4113b44f0e819c3cb5b1195e504b",
30+
"kdumpctl": "2d6d70544525cdbdea999307b7a2631c6f9cda51a02225dfb4159bc6a45ce465",
3131
"kdumpctl.8": "025a39d212eed0584da7c23c1bb50d6ab797a0fa3c686ac6b80391af875dbaec",
3232
"kexec-kdump-howto.txt": "e783390a9aa582a2b5e7981cd3277081385340b5873a3f0633c789811876eccb",
3333
"kexec-tools-2.0.27.tar.xz": "38d78bcfa33a88928324b57dc81f50c1dfc279eede45e80957ca18f4e84b8187",

SPECS/kexec-tools/kexec-tools.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: The kexec/kdump userspace component
77
Name: kexec-tools
88
Version: 2.0.27
9-
Release: 7%{?dist}
9+
Release: 8%{?dist}
1010
License: GPLv2
1111
Vendor: Microsoft Corporation
1212
Distribution: Azure Linux
@@ -330,6 +330,9 @@ done
330330
/usr/share/makedumpfile/
331331

332332
%changelog
333+
* Mon Sep 30 2024 Nicholas Angelastro <[email protected]> - 2.0.27-8
334+
- Add kdump option to disable rebooting after saving crash dump
335+
333336
* Tue Jul 09 2024 Chris Co <[email protected]> - 2.0.27-7
334337
- Remove requires on dhcp-client
335338

0 commit comments

Comments
 (0)