Force a process to coredump

Ensure “gdb” is installed.

Example to force running "crond" process to coredump.

[root@centos ~]# gcore $(pidof crond)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/".
0x00007f8c0f444ee0 in __nanosleep_nocancel () from /lib64/
warning: target file /proc/7011/cmdline contained unexpected null characters
Saved corefile core.7011
[root@centos ~]# ls
[root@centos ~]# file core.7011 
core.7011: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from '/usr/sbin/crond'

No comments: