【发布时间】:2017-08-16 22:38:37
【问题描述】:
我知道我可以通过在 /etc/profile 文件中创建以下条目来为新进程启用核心转储
ulimit -c unlimited >/dev/null 2>&1
是否可以为已经运行的进程启用核心转储?
【问题讨论】:
我知道我可以通过在 /etc/profile 文件中创建以下条目来为新进程启用核心转储
ulimit -c unlimited >/dev/null 2>&1
是否可以为已经运行的进程启用核心转储?
【问题讨论】:
正如this post 所说,
(在 CentOs/Red Hat 上)如果您的内核是 2.6.32+,您可以手动更改它,如下所示:
cd /proc/7671/
[root@host 7671]# cat limits | grep nice
Max nice priority 0 0
[root@host 7671]# echo -n "Max nice priority=5:6" > limits
[root@host 7671]# cat limits | grep nice
Max nice priority 5 6
否则可以使用prlimit工具(util-linux 2.21引入),如下:
[root@host 986]# prlimit --core=1000000 --pid 23578
[root@host 986]# prlimit --pid 23578 | grep CORE
CORE max core file size 1000000 1000000 bytes
希望对你有帮助
【讨论】: