[英]core kernel pattern %e on Linux appends PID
According to documentation of core the %e in kernel pattern stands for 'The process or thread's comm value'.根据核心文档,kernel 模式中的 %e 代表“进程或线程的通信值”。 in addition the core comm value is defined as whatever /proc/[pid]/comm returns.
此外,核心 comm 值被定义为 /proc/[pid]/comm 返回的任何值。 However on my machine (CentOs) despite the kernel pattern is defined as core-%e and comm value returns only process name, PID is still appended to the core name.
然而,在我的机器(CentOs)上,尽管 kernel 模式被定义为 core-%e 并且 comm 值仅返回进程名称,PID 仍然附加到核心名称。 Why is this discrepancy between the documentation and actual behaviour?
为什么文档和实际行为之间存在这种差异?
[root@mde-segment-bouretskey dump]# cat /proc/sys/kernel/core_pattern
/tmp/dump/core-%e
[root@mde-segment-bouretskey dump]# ls /tmp/dump/core-*
/tmp/dump/core-a.out.42098 /tmp/dump/core-a.out.43097
[root@mde-segment-bouretskey dump]#
[root@mde-segment-bouretskey crashtest]# cat /proc/45301/comm
a.out
You need to set kernel.core_uses_pid=0
to avoid having the pid appended when %p
is missing.您需要设置
kernel.core_uses_pid=0
以避免在缺少%p
时附加 pid。
From core(5):从核心(5):
For backward compatibility, if /proc/sys/kernel/core_pattern does not include %p and /proc/sys/kernel/core_uses_pid (see below) is nonzero, then.PID will be appended to the core filename.
为了向后兼容,如果 /proc/sys/kernel/core_pattern 不包含 %p 并且 /proc/sys/kernel/core_uses_pid (见下文)非零,则 .PID 将附加到核心文件名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.