How to disable core dumps on Debian 8

Solution 1:

After Michael Hampton's comment to the Froggiz' answer, I noticed that Debian seems to lack a coredump.conf manpage, so I've looked for it on the internet and found it. That manpage contains a lot of useful informations and I wonder why Debian ships without it (maybe Debian is shipping without the whole systemd-coredump thing?).

However from that manpage and the systemd-coredump manpage it seems that the core files I get do not come from systemd, because systemd puts them in /var/lib/systemd/coredump or in the journal depending on the Storage option, but never in the working directory of the crashed process. Moreover the systemd-coredump manpage (also missing in Debian) says that for the core dump functionality to work, you need to configure the kernel.core_pattern sysctl parameter to make the kernel actually hand the core dump to systemd-coredump.

I've then looked at Debian value for kernel.core_pattern: Debian comes with that parameter set to "core" by default, which happens to be exactly the name of the core dump files I get.

I now suppose that setting

kernel.core_pattern=|/bin/true

(or /bin/false for that matter) in sysctl.conf as per the core(5) manpage will solve the problem.

I'm going to evetually accept my answer in a few weeks if I notice the server stops creating core files. I'm sorry I can't accept Michael's comment as answer, but many thanks to him for pointing me in what I believe is the right direction.

EDIT: I've found here a way to test the configuration without having to wait for a spontaneous crash and I confirm this is the correct answer.

Solution 2:

You can try this : https://wiki.archlinux.org/index.php/Systemd#Disabling_application_crash_dumps_journaling

Disabling application crash dumps journaling Edit the file /etc/systemd/coredump.conf by adding this line: Storage=none

and run: systemctl daemon-reload to reload the configuration.