分类 linux 中的文章

linux 配置生成 core 文件

一、配置允许生成的 core 文件数量 vim /etc/security/limits.conf 添加 * soft core 1024 # 表示允许生成的最大 core 数量为 1024 二、配置 core 文件名 # format the name of core file. # %% – 符号% # %p – 进程号 # %u – 进程用户id # %g – 进程用户组id # %s – 生成core文件时收到的信号 # %t – 生成core文件的时间戳(seconds since 0:00h, 1 Jan 1970) # %h – 主机名 # %e – 程序文件名 echo -e "core-%p-%t" > /proc/sys/kernel/core_pattern # or run the following command # sysctl -w kernel.core_pattern=/corefile/core-%p-%t # 注意: 这个配置重启机器后,会失效。需要重新设置或者采用永久配置生效方法 三、 配置 core 使用 pid (此步骤可不配置) echo -e "1" > /proc/sys/kernel/core_uses_pid # or run the following command # sysctl -w kernel.……

阅读全文