Skip to content

Commit c9feebe

Browse files
committed
Add active dump check in kdump and FADump plugin
When the kernel panics it generates /proc/vmcore file that contains physical memory of crashed kernel. If the kdump/FADump is configured, system boots with secondary/capture kernel and detects the /proc/vmcore file to collect the dump. Now for some reason if kdump service failed to collect dump the it remains active in the system until we reboot the system. If system has an active dump then it may create problem during next kernel crash. This patch adds a check in kdump and fadump plugin to ensure that there is no active dump in the system and if found raise flag to reboot the system. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
1 parent 0191872 commit c9feebe

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

servicereportpkg/repair/plugins/fadump_repair.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,9 @@ def repair(self, plugin_obj, checks):
229229
dump_comp_initrd_check)
230230
elif dump_comp_initrd_check.get_status() is None:
231231
dump_comp_initrd_check.set_note(Notes.FAIL_TO_FIX)
232+
233+
active_dump = check_dir["Active dump"]
234+
if active_dump.get_status() is False:
235+
active_dump.add_note("Active dump found, needs reboot")
236+
if active_dump.get_status() is None:
237+
active_dump.add_note(Notes.FAIL_TO_FIX)

servicereportpkg/repair/plugins/kdump_repair.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,9 @@ def repair(self, plugin_obj, checks):
320320
init_ramdisk_comp)
321321
elif init_ramdisk_comp.get_status() is None:
322322
init_ramdisk_comp.set_note(Notes.FAIL_TO_FIX)
323+
324+
active_dump = check_dir["Active dump"]
325+
if active_dump.get_status() is False:
326+
active_dump.add_note("Active dump found, needs reboot")
327+
if active_dump.get_status() is None:
328+
active_dump.add_note(Notes.FAIL_TO_FIX)

servicereportpkg/validate/plugins/kdump.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from servicereportpkg.utils import get_file_size, is_string_in_file
1919
from servicereportpkg.check import PackageCheck, ServiceCheck, Check
2020
from servicereportpkg.check import SysfsCheck, ConfigurationFileCheck
21+
from servicereportpkg.check import FileCheck
2122
from servicereportpkg.utils import get_service_status, execute_command
2223
from servicereportpkg.validate.schemes.schemes import FedoraScheme, SuSEScheme
2324
from servicereportpkg.validate.schemes.schemes import RHELScheme, UbuntuScheme
@@ -32,6 +33,7 @@ def __init__(self):
3233
self.initial_ramdisk = ""
3334
self.log = get_default_logger()
3435
self.kernel_release = platform.release()
36+
self.active_dump = "/proc/vmcore"
3537

3638
def check_is_dump_service_active(self):
3739
"""Service status"""
@@ -99,6 +101,13 @@ def check_kexec_package(self):
99101
return PackageCheck(self.check_kexec_package.__doc__,
100102
package, status)
101103

104+
def check_active_dump(self):
105+
"""Active dump"""
106+
107+
status = not os.path.isfile(self.active_dump)
108+
return FileCheck(self.check_active_dump.__doc__,
109+
self.active_dump, status)
110+
102111

103112
class Kdump(Dump):
104113
"""Kdump configuration check"""

0 commit comments

Comments
 (0)