I am not sure if stackoverflow is the correct place for this, but since this is for embedded deve开发者_Python百科lopment, and I need core dumps, which are also for development, I figured that this was the best place to ask.
I am trying to enable global core dumps in such a way that every time a program crashes in a way which produces a core, it gets written to /foo/bar/core. Every time a program crashes, it overwrites the old core file. Currently I have tried the following:
Adding this to limits.conf
#<domain> <type> <item> <value>
* soft core unlimited
root soft core unlimited
# End of file
Adding this to sysctl.conf:
# Core Files
kernel.core_pattern=/mnt/ffs/core
kernel.core_uses_pid=0
This did not work. If I boot the system, do a sysctl -p
, ulimit -c unlimited
and then restart the processes by hand (without the init script), I get a core file in /foo/bar, but it has the PID appended. Any help would be greatly appreciated.
I set the core pattern to not include any process dependent information, yet the kernel still wanted to append the PID, so I ended up removing that bit of code from the kernel, and everything works fine now.
精彩评论