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
flame C204800
in /etc/limits (limiting to 20MB of dump). But I still have to try 🙂
Great tip, thanks for passing it on ;0) I’m running a bit of unstable packages too (besides developing my own C-programs :p), so I’m also getting a bit of crashes. However, I found that setting up /etc/limits had no effect and that no package on my system seems to own it, so I was about to go back to a custom /etc/bash/bashrc. Searching for *limit* in /etc/ gave /etc/security/limits.conf, though, which is for pam and setting this file up gave the expected result ;0)