开发者

How to dump core of an init spawned process

开发者 https://www.devze.com 2023-03-11 03:37 出处:网络
I am trying to force core dump of a program. Core dumping is enabled via ulimit -c unlimited If my program is launched by the init process, and I kill it like this

I am trying to force core dump of a program. Core dumping is enabled via

ulimit -c unlimited

If my program is launched by the init process, and I kill it like this

kill -6 <pid_of_prog>

I can't find the core.

However, if it is launched from a terminal, and I kill it with the above command, then it dumps core. The program chdir to 开发者_如何学运维a directory when it is launched, and the core file is found in this directory.


ulimit does not set the limit of already launched process, so my init launched process is not affected by the ulimit command. I guess the correct answer is to use setrlimit

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号