进程停止而不在OpenVZ Container上创建核心转储

时间:2012-03-22 07:33:26

标签: linux-kernel coredump openvz

我在容器中运行进程(服务)。几分钟后,进程停止(或崩溃),但没有生成核心转储。

当我尝试有意创建核心转储时(例如,在我的程序中除以10/0),它会创建一个核心转储。

但是相同的过程(没有故意崩溃)将停止并且不会创建核心转储。

可能是什么问题?

以下是我在VPS上的内核的更具体细节:

[root@test101 ~]# sysctl -a |egrep -i "core"
kernel.core_uses_pid = 1
kernel.core_pattern = core.%e.%p
kernel.core_pipe_limit = 4
net.core.somaxconn = 128
net.core.xfrm_aevent_etime = 10
net.core.xfrm_aevent_rseqth = 2
net.core.xfrm_larval_drop = 1
net.core.xfrm_acq_expires = 30
net.core.wmem_max = 131071
net.core.rmem_max = 131071
net.core.wmem_default = 133120
net.core.rmem_default = 133120
net.core.dev_weight = 64
net.core.netdev_max_backlog = 1000
net.core.message_cost = 5
net.core.message_burst = 10
net.core.optmem_max = 20480
net.core.rps_sock_flow_entries = 0
net.core.netdev_budget = 300
net.core.warnings = 1

[root@test101 ~]# ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 8041
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

1 个答案:

答案 0 :(得分:0)

在/etc/security/limits.conf中添加以下行:

  • 软核无限
  • 硬核无限 根软核无限 root hard core unlimited