核心文件存储在lxc容器中的什么位置? [英] Where are core files stored in a lxc container?

查看:119
本文介绍了核心文件存储在lxc容器中的什么位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在容器核心上运行代码时,无法在我的容器上找到它(或未存储核心文件).

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).

  1. ulimit -c设置为unlimited
  2. /proc/sys/kernel/core_pattern设置为 |/usr/share/apport/apport %p %s %c %P(|是什么意思?)
  1. ulimit -c is set to unlimited
  2. /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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆