How to change core dump path to current dir in RHEL 8+ onwards and test it ?

From RHEL 8 onwards, the default core file path is changed to /var/lib/systemd/coredump unlike till RHEL 7 where its saved in current path by default.

We can use below steps to change the core dump to current directory from RHEL 8+ onwards.

1. Put below line in sysctl.conf.

kernel.core_pattern = core-%e-%s-%u-%g-%p-%t

 

2. Refresh the service

# systemctl daemon-reload   //Required as systemd controls this setting and needs a   refresh.
# sysctl -p

 

3. Test the change

[root@ngelinux ~]# sleep 3600 &
[1] 1289952
[root@ngelinux ~]# kill -11 %1
[root@ngelinux ~]#
[1]+ Segmentation fault (core dumped) sleep 3600
[root@ngelinux ~]# ls -ltr
total 176
------ 1 root root 401408 Apr 28 15:20 core-sleep-11-0-0-1289952-1745833822

As we can see above, now the core is dumped to current path as configured in core pattern kernel paramter.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments