Getting core dumps

From Finninday
Jump to: navigation, search

ulimit -c unlimited
mkdir -p /var/log/cores
echo '/var/log/cores/core.%e.%s.%p.%t' > /proc/sys/kernel/core_pattern
echo '1' > /proc/sys/fs/suid_dumpable

Start process
Kill the process

Redhat support recommends this:

1) vi /etc/security/limits.conf

* soft core unlimited 

2) vi /etc/sysconfig/init DAEMON_COREFILE_LIMIT="unlimited" The file /etc/init.d/functions uses this corelimit value (line numbering enabled)

238 # make sure it doesn't core dump anywhere unless requested 
239 corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}" 

3) vi /etc/sysctl.conf kernel.core.pattern - /tmp/core-%p