如何在 montavista Linux 上启用守护进程的核心转储?
我不确定 stackoverflow 是否是正确的地方,但由于这是用于嵌入式开发,并且我需要核心转储,这也用于开发,所以我认为这是询问的最佳位置。
我试图以这样的方式启用全局核心转储,每次程序以生成核心的方式崩溃时,它都会被写入 /foo/bar/core。每次程序崩溃时,它都会覆盖旧的核心文件。目前我已尝试以下操作:
将其添加到limits.conf
#<domain> <type> <item> <value>
* soft core unlimited
root soft core unlimited
# End of file
将其添加到sysctl.conf:
# Core Files
kernel.core_pattern=/mnt/ffs/core
kernel.core_uses_pid=0
这不起作用。如果我启动系统,执行sysctl -p
、ulimit -c unlimited
,然后手动重新启动进程(无需初始化脚本),我会在/foo/bar,但它附加了 PID。任何帮助将不胜感激。
I am not sure if stackoverflow is the correct place for this, but since this is for embedded development, 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将核心模式设置为不包含任何与进程相关的信息,但内核仍然想附加 PID,因此我最终从内核中删除了那段代码,现在一切正常。
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.