【问题标题】:Enable Core Dump for already running processes in Redhat为 Redhat 中已运行的进程启用核心转储
【发布时间】:2017-08-16 22:38:37
【问题描述】:

我知道我可以通过在 /etc/profile 文件中创建以下条目来为新进程启用核心转储 ulimit -c unlimited >/dev/null 2>&1

是否可以为已经运行的进程启用核心转储?

【问题讨论】:

    标签: linux redhat coredump


    【解决方案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
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2017-02-12
      • 2015-05-12
      • 1970-01-01
      • 1970-01-01
      • 2013-10-20
      • 1970-01-01
      • 1970-01-01
      • 2021-07-16
      相关资源
      最近更新 更多