You are not logged in.

#1 2024-01-19 10:12:07

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 243

[SOLVED] Core file size hard limit became 0

I want to disable core dumps by default and enable it manually from shell only when i need it.

I have configured /etc/systemd/system.conf:

DumpCore=no
DefaultLimitCORE=0

/etc/systemd/coredump.conf:

Storage=none

/etc/sysctl.d/50-coredump.conf (overrides /usr/lib/sysctl.d/50-coredump.conf):

kernel.core_pattern=core.%e
kernel.core_uses_pid=1
kernel.core_pipe_limit=16
fs.suid_dumpable=0

/etc/security/limits.conf:

    *   hard    core    unlimited
    *   soft    core    0

By default soft limit is 0 and no core dumped:

$ ulimit -c
0
$ ./abort 
Aborted

If i wanted to get core dump, i just unlimited it from shell:

$ ulimit -c unlimited
$ ./abort 
Aborted (core dumped)

It worked like a charm for years.

Recently i noticed it doesn't work anymore for regular user:

$ ulimit -c unlimited
bash: ulimit: core file size: cannot modify limit: Operation not permitted
$
$ ulimit -c -H
0

Now hard limit is 0 regardless of /etc/security/limits.conf settings.

What has been changed? What overrides core file size hard limit?

Last edited by dimich (2024-01-19 10:33:31)

Offline

#2 2024-01-19 10:33:17

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 243

Re: [SOLVED] Core file size hard limit became 0

Change

DefaultLimitCORE=0

to

DefaultLimitCORE=0:infinity

in /etc/systemd/system.conf seems fixed the issue.

Last edited by dimich (2024-01-19 10:36:54)

Offline

Board footer

Powered by FluxBB