核心文件存储在lxc容器中的什么位置? [英] Where are core files stored in a lxc container?
问题描述
当我在容器核心上运行代码时,无法在我的容器上找到它(或未存储核心文件).
When I am running code on a container it cores I am not able to locate it on my container(or the core file is not being stored).
-
ulimit -c
设置为unlimited
-
/proc/sys/kernel/core_pattern
设置为|/usr/share/apport/apport %p %s %c %P
(|
是什么意思?)
ulimit -c
is set tounlimited
/proc/sys/kernel/core_pattern
is set to|/usr/share/apport/apport %p %s %c %P
(what is the meaning of|
?)
我是否需要对主机系统进行任何更改?
Do I need to make any changes in/to the host system?
推荐答案
|
表示程序应处理核心转储.与其将coredump保存到文件中,不如将其转储到该程序输入中.意味着如果core_pattern
设置为|... apport
apport
将处理核心转储.
|
indicates that a program should handle the core dump. Rather than saving the coredump to a file it will be piped into that programs input. Means if core_pattern
is set to |... apport
apport
will handle the core dumps.
不幸的是,apport
仅会为installed
软件包创建核心转储.我将模式设置为文件名,如下所示:
Unfortunately apport
will create coredumps only for installed
packages. I would set the pattern to a file name, like this:
echo '/tmp/cores/core.%e.%p.%t' > /proc/sys/kernel/core_pattern
这将为您提供/tmp/core.program.pid.012345678
之类的核心转储,其中program
是程序名称,pid
该程序的pid加上末尾的时间戳记.
The would give you coredumps like /tmp/core.program.pid.012345678
where program
is the program name, pid
the program's pid plus a timestamp at the end.
检查 man core
了解更多信息(尤其是信息关于可以在核心模式中使用的元字符.
Check man core
for more information (espcecially information about meta chars that can be used in the core pattern.
这篇关于核心文件存储在lxc容器中的什么位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!