[systemd-devel] How to suppress coredumps when systemd-coredump is in use?

Lennart Poettering lennart at poettering.net
Tue Jan 12 09:51:09 PST 2016


On Fri, 08.01.16 17:31, Robert O'Callahan (robert at ocallahan.org) wrote:

> http://rr-project.org has a test suite which runs a lot of programs that
> intentionally crash with core-dumping signals. I added "ulimit -c 0" to the
> test suite to suppress those core dumps, but I discovered that doesn't work
> when systemd has set /proc/sys/kernel/core_pattern to
> "|/usr/lib/systemd/systemd-coredump". (Apparently the kernel ignores that
> rlimit when a coredump is piped to a process.) So thousands of files get
> stashed in /var/lib/systemd/coredump every time the test suite runs :-(.
> 
> Is there any way to avoid this on my side or systemd's? Making it
> impossible to disable coredumps seems bad. Maybe systemd could query the
> dumping process's RLIMIT_CORE with prlimit() and throw the coredump away if
> the limit is 0. Obvoiusly I could modify /proc/sys/kernel/core_pattern but
> I'd like a solution that works for everyone without messing with their
> system configuration.

Yes, we really should check RLIMIT_CORE of the dumped process, and
honour it. Happy to take a patch for that!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list