Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #209834 > unrolled thread

How to disable automatic core dumps in Debian 9?

Started byMartin T <m4rtntns@gmail.com>
First post2019-06-12 11:50 +0200
Last post2019-06-12 16:40 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  How to disable automatic core dumps in Debian 9? Martin T <m4rtntns@gmail.com> - 2019-06-12 11:50 +0200
    Re: How to disable automatic core dumps in Debian 9? Reco <recoverym4n@enotuniq.net> - 2019-06-12 14:00 +0200
      Re: How to disable automatic core dumps in Debian 9? Martin T <m4rtntns@gmail.com> - 2019-06-12 16:20 +0200
        Re: How to disable automatic core dumps in Debian 9? Reco <recoverym4n@enotuniq.net> - 2019-06-12 16:40 +0200

#209834 — How to disable automatic core dumps in Debian 9?

FromMartin T <m4rtntns@gmail.com>
Date2019-06-12 11:50 +0200
SubjectHow to disable automatic core dumps in Debian 9?
Message-ID<y883g-5Is-5@gated-at.bofh.it>
Hi,

how to disable all automatic core dumps upon the process termination
in Debian 9? As Debian does not seem to use systemd-coredump, then I
set the "kernel.core_pattern=|/bin/false" kernel configuration in
sysctl.conf and following pam_limits.so module configuration:

$ grep -w core /etc/security/limits.conf
#        - core - limits the core file size (KB)
*               hard    core            0
root            hard    core            0
#root            hard    core            100000
$

When I execute a program, which crashes, then while the "core dumped"
is printed:

$ ./testprogram
Floating point exception (core dumped)
$

..then no actual core dump does not seem to be created.

Is the configuration above enough to disable core dumps or am I
missing something?

thanks,
Martin

[toc] | [next] | [standalone]


#209840

FromReco <recoverym4n@enotuniq.net>
Date2019-06-12 14:00 +0200
Message-ID<y8a53-6St-1@gated-at.bofh.it>
In reply to#209834
	Hi.

On Wed, Jun 12, 2019 at 12:49:14PM +0300, Martin T wrote:
> As Debian does not seem to use systemd-coredump,

It's a feature, not a flaw.


> then I set the "kernel.core_pattern=|/bin/false" kernel configuration
> in sysctl.conf

sysctl -w kernel.core_pattern=/dev/null

There's no need to pipe the core to /bin/false if you don't need the
core in the first place.


> and following pam_limits.so module configuration:
> 
> $ grep -w core /etc/security/limits.conf
> #        - core - limits the core file size (KB)
> *               hard    core            0
> root            hard    core            0
> #root            hard    core            100000
> $

rgrep core /etc/security/limits*

Would be more correct. Files at /etc/security/limits.d/ can override
limits.conf.


> Ween I execute a program, which crashes, then while the "core dumped"
> is printed:

A simple 'ulimit -c' would suffice.

Reco

[toc] | [prev] | [next] | [standalone]


#209842

FromMartin T <m4rtntns@gmail.com>
Date2019-06-12 16:20 +0200
Message-ID<y8cgx-8lB-7@gated-at.bofh.it>
In reply to#209840
Reco,

thanks for reply!

> rgrep core /etc/security/limits*
> Would be more correct. Files at /etc/security/limits.d/ can override limits.conf.

Indeed. Output of "rgrep core /etc/security/limits*" is following:

$ rgrep core /etc/security/limits*
/etc/security/limits.conf:#        - core - limits the core file size (KB)
/etc/security/limits.conf:*               hard    core            0
/etc/security/limits.conf:root            hard    core            0
/etc/security/limits.conf:#root            hard    core            100000
$

So in short, the configuration in my initial e-mail was enough to
disable core dumps? After reading the "man 5 core", I also set the
"kernel.core_uses_pid" to 0.


thanks,
Martin

[toc] | [prev] | [next] | [standalone]


#209843

FromReco <recoverym4n@enotuniq.net>
Date2019-06-12 16:40 +0200
Message-ID<y8czT-8sa-5@gated-at.bofh.it>
In reply to#209842
	Hi.

On Wed, Jun 12, 2019 at 05:14:09PM +0300, Martin T wrote:
> Reco,
> 
> thanks for reply!
> 
> > rgrep core /etc/security/limits*
> > Would be more correct. Files at /etc/security/limits.d/ can override limits.conf.
> 
> Indeed. Output of "rgrep core /etc/security/limits*" is following:
> 
> $ rgrep core /etc/security/limits*
> /etc/security/limits.conf:#        - core - limits the core file size (KB)
> /etc/security/limits.conf:*               hard    core            0
> /etc/security/limits.conf:root            hard    core            0
> /etc/security/limits.conf:#root            hard    core            100000
> $
> 
> So in short, the configuration in my initial e-mail was enough to
> disable core dumps?

I prefer to do it this way, but that's a matter of a personal preference
(note that it works for root too):

*	-	core	0

Overriding kernel.core_pattern is way too limiting for me. I need those
core files in certain cases (but live happily without them by default).


> After reading the "man 5 core", I also set the "kernel.core_uses_pid" to 0.

Zero is a default value for this in Debian anyway. So - can't hurt, but
I doubt it'll change something for you.

Reco

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web