Skip to content

Instantly share code, notes, and snippets.

@toddlers
Created March 5, 2014 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlers/9364456 to your computer and use it in GitHub Desktop.
Save toddlers/9364456 to your computer and use it in GitHub Desktop.
enable coredump in centos
Step 1.
Edit /etc/security/limits.conf
Step 2.
Notice this is set to all processes but if you have a process running as a service account replace the * with the service account.
Step 3.
Next, you will have to restart the process for this change to go into effect.
# vi /etc/security/limits.conf
#* soft core 0
* soft core unlimited
Step 4.
Edit /etc/sysctl.conf and add where to put the core file and any naming standard.
# vi /etc/sysctl.conf
kernel.core_pattern = /tmp/core-%e-%s-%u-%g-%p-%t
fs.suid_dumpable = 2
Filename variables:
%e is the filename
%g is the gid the process was running under
%p is the pid of the process
%s is the signal that caused the dump
%t is the time the dump occurred
%u is the uid the process was running under
Step 5.
Edit the /etc/sysconfig/init and set a core file limit:
# vi /etc/sysconfig/init
DAEMON_COREFILE_LIMIT='unlimited'
Step 6.
Finally, issue this command:
# sysctl -p
That’s it. So finally next time if your server crash, you will already have a core file created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment