It’s not the first time I blog of something just not to forget about that 😛 This time it’st he turn of how to set the name of core dump files to something meaningful so that I can know which hell of an app left them around.
I have to thank ehmsen and brix for pointing me to the right directions as I had no clue how to do that before 🙂
Why do I need such a name scheme? Well I’m experiencing some strange crashes lately with akregator and a few other programs so I’m tempted to just get a backtrace and then check where the problem is hidden, unfortunately by enabling corefiles for everything you get a lot of files named “core” or “core.<pid>”, nothing useful to recognise what you’re looking for.
So what’s the solution? /proc/sys/kernel/core_pattern is where the kernel take the template for the core files naming… so I just changed that to ‘%e.%p.core’ and now i have the files just called “<executable>.<pid>.core” (so that they don’t overwrite each other). Good eh? 🙂
To make this a stable change, just put at the end of /etc/sysctl.conf the line
kernel.core_pattern = %e.%p.core
Now, I just need to remember how to enable core files for my user to be always generated … 😛
IIRC it should be something like
in /etc/limits (limiting to 20MB of dump). But I still have to try 🙂