如何从Ubuntu Precise上的xinetd启动的服务获取核心转储

时间:2015-01-08 19:34:19

标签: ubuntu-12.04 core xinetd

我想使用SIGPIPE调试失败的服务。所以我为SIGPIPE安装了一个信号处理程序,并在其中调用abort()以获得核心转储。

但我没有。我已设置sysctl -w kernel.core_pattern=/tmp/core以将core转换为tmp,并设置为/etc/security/limits.confulimit -c unlimited

那么,我怎样才能获得core

我的xinetd-service文件如下所示:

service netmaumau
{
    socket_type = stream
    protocol    = tcp
    port        = 8899
    type        = UNLISTED
    flags       = KEEPALIVE
    disable     = no
    wait        = yes
    user        = heiko
    instances   = 1
    cps         = 1 10
    server      = /long/path/to/nmm-server
    server_args = -a
    log_on_success = PID HOST EXIT
    log_on_failure = HOST
}

1 个答案:

答案 0 :(得分:0)

添加

struct rlimit rl = { RLIM_INFINITY, RLIM_INFINITY }; 
setrlimit(RLIMIT_CORE, &rl);

解决了问题