Wednesday, June 27, 2018

Change coredump file location

# verify current setting
sysctl   kernel.core_pattern

You can change default core dump as below:
echo '/var/log/testprogram/core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern

# verify the setting
sysctl   kernel.core_pattern

Now, all the programs if any major faults, will generate coredump in the above directory configured.

Here %e - program name , %p - pid of process

Check, man core for more details.

This article discussed about how to compress the core file generated:

No comments:

Post a Comment