gpt4 book ai didi

linux - 为 Redhat 中已经运行的进程启用核心转储

转载 作者:太空宇宙 更新时间:2023-11-04 10:16:56 25 4
gpt4 key购买 nike

我知道我可以通过在/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

希望对你有帮助

关于linux - 为 Redhat 中已经运行的进程启用核心转储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45714267/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com