You are not logged in.

#1 2012-12-12 12:20:41

andr3as
Member
Registered: 2008-10-06
Posts: 51

[Solved] Systemd: how to disable core dumps on application crashes?

Hi,

I'm sorry if this is the wrong forum, but I just couldn't find a place that's really suitable for such a question.

I have a really annoying problem with systemd: I'm developing software, which sometimes crashes. And when it crashes, I sometimes want to examine core dumps.
The problem is that systemd seems to force coredumps, but saves them in some kind of obscure internal storage, where I don't have a clue about how to extract them from.
The only hint that I could find was http://lists.freedesktop.org/archives/s … 04643.html which isn't really helpful.

The problem is that systemd installs its coredump handler on boot:

[root@neptun ~]# cat /proc/sys/kernel/core_pattern
|/usr/lib/systemd/systemd-coredump %p %u %g %s %t %e

Is there any way to disable this? I don't want core dumps to be generated unless I need them. Just clearing that file on boot seems too hackish for me, does anybody know if there is a systemd
configuration option to turn coredumps off?

Cheers,
andr3as

Last edited by andr3as (2012-12-15 01:42:24)

Offline

#2 2012-12-12 12:32:26

xpixelz
Member
From: Tunisia
Registered: 2012-02-29
Posts: 47
Website

Re: [Solved] Systemd: how to disable core dumps on application crashes?

Just link coredump.conf to /dev/null then apply with sysctl :

# ln -s /dev/null /etc/sysctl.d/coredump.conf
# /lib/systemd/systemd-sysctl

Offline

#3 2012-12-15 01:42:12

andr3as
Member
Registered: 2008-10-06
Posts: 51

Re: [Solved] Systemd: how to disable core dumps on application crashes?

Thanks a lot, this works!

Offline

#4 2012-12-18 20:02:01

Thralas
Member
Registered: 2007-06-26
Posts: 32

Re: [Solved] Systemd: how to disable core dumps on application crashes?

Slight kick; Coredumps are stored in the systemd journal. systemd-coredumpctl(1) can be used to list and dump stored coredumps

Offline

#5 2012-12-29 13:16:34

Occi
Member
From: Norway
Registered: 2011-09-18
Posts: 24
Website

Re: [Solved] Systemd: how to disable core dumps on application crashes?

xpixelz wrote:

Just link coredump.conf to /dev/null then apply with sysctl :

# ln -s /dev/null /etc/sysctl.d/coredump.conf
# /lib/systemd/systemd-sysctl

Worked for me too, but had define the maximum coredump size aswell:

$ ulimit -c unlimited

Offline

#6 2013-07-06 09:51:10

Spider.007
Member
Registered: 2004-06-20
Posts: 1,151
Website

Re: [Solved] Systemd: how to disable core dumps on application crashes?

The .conf file was recently renamed so the symlink must be called different as well. But I found it needs to contain something to actually overload systemd's default

# echo kernel.core_pattern= > /etc/sysctl.d/50-coredump.conf
# /lib/systemd/systemd-sysctl
# cat /proc/sys/kernel/core_pattern # should be empty

Last edited by Spider.007 (2013-07-13 10:06:41)

Offline

#7 2013-07-11 09:37:45

xjpvictor
Member
From: Singapore
Registered: 2008-04-05
Posts: 16
Website

Re: [Solved] Systemd: how to disable core dumps on application crashes?

Yes Spider was right. ln -s /dev/null is not working for me any more.


Entschuldigung. Ich habe keine ahnung.
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary

Offline

#8 2013-07-16 16:16:42

stqn
Member
Registered: 2010-03-19
Posts: 1,189
Website

Re: [Solved] Systemd: how to disable core dumps on application crashes?

Hi guys,
I just spent way too much time fixing this problem *again* and updated the wiki article about it.
I found that simply setting "core_pattern" to an empty string didn’t work; core files were created with a name like ".<pid>".

Offline

Board footer

Powered by FluxBB