更改core文件生成目录、扩展名
1.设置pid为扩展名
/proc/sys/kernel/core_uses_pid 配置目录
===============================================================
sysctl -w kernel.core_uses_pid=1 kernel.core_uses_pid = 1
2.更改生成目录(一般都是当前目录
/proc/sys/kernel/core_pattern 配置目录
================================================================
sysctl -w kernel.core_pattern=./core.%e.%p.%s.%E(这是生成到当前目录下面 ./
sysctl -w kernel.core_pattern=/xxxxxxx/core.%e.%p.%s.%E(这是生成到xxxxx/目录下面
为了方便更改,下面是命令
以下是参数列表:
%p - insert pid into filename 添加pid(进程id)
%u - insert current uid into filename 添加当前uid(用户id)
%g - insert current gid into filename 添加当前gid(用户组id)
%s - insert signal that caused the coredump into the filename 添加导致产生core的信号
%t - insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间
%h - insert hostname where the coredump happened into filename 添加主机名
%e - insert coredumping executable name into filename 添加导致产生core的命令名