Kdump & /etc/kdump/pre.d/* Not working


I am trying to run a custom script before the kdump (ie
/etc/kdump/pre.d/* ) which seems not to work. I am failing to understand what obvious step I am missing. Has someone tried this?

While the “echo c > /proc/sysrq-trigger” successfully reboots the
output is not what is expected.

I could see nothing special under /var/log/kdump.log and journalctl -x

Here is my setup for kdump/kexec.


-------Expected output-------

01. Under /var/crash we should be having a folder as "DBGMSG-<date>".
02. vmcore file
03. dmesg file

-------current output-------

Nothing under /var/crash

# uname -a
Linux rockky85 4.18.0-348.el8.0.2.x86_64 #1 SMP Sun Nov 14 00:51:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa | grep kexec

# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/boot/vmlinuz-4.18.0-348.el8.0.2.x86_64 root=UUID=... ro crashkernel=128M resume=UUID=...

# cat /etc/kdump.conf (only relevant stuff)

path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31

# tree /etc/kdump/

├── post.d
└── pre.d
    └── 50-collect.sh

[Has execute permisison]
# ls -ali /etc/kdump/pre.d/50-collect.sh

656101 -rwxr-xr-x 1 root root 284 May 12 16:24 /etc/kdump/pre.d/50-collect.sh

# cat /etc/kdump/pre.d/50-collect.sh


# base location
# dbgmsg identifier string
# log file
# Granularity in seconds 
LOCFOLDER=${LOC}/$DBGMSG-$(date +%Y-%m-%d:%H:%M:%S)

# Create folder.
mkdir -p $LOCFOLDER
mkdir -p /var/crash/110
exit 0

Selinux and firewalld is currently disabled.

# sestatus 
SELinux status:                 disabled

# systemctl is-active firewalled