]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/main.c
core: set RLIMIT_CORE to unlimited by default
authorLennart Poettering <lennart@poettering.net>
Mon, 8 Feb 2016 21:30:58 +0000 (22:30 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 10 Feb 2016 15:09:20 +0000 (16:09 +0100)
commit15a900327aba7dc4dc886affe1ae22d3b759b193
tree7db243c578e76656b97668479dc246bc6b9742ec
parentbdfd7b2c63cac944a3aa1fc0fafd19f41789e208
core: set RLIMIT_CORE to unlimited by default

The kernel sets RLIMIT_CORE to 0 by default. Let's bump this to unlimited by
default (for systemd itself and all processes we fork off), so that the
coredump hooks have an effect if they honour it.

Bumping RLIMIT_CORE of course would have the effect that "core" files will end
up on the system at various places, if no coredump hook is used. To avoid this,
make sure PID1 sets the core pattern to the empty string by default, so that
this logic is disabled.

This change in defaults should be useful for all systems where coredump hooks
are used, as it allows useful usage of RLIMIT_CORE from these hooks again. OTOH
systems that expect that coredumps are placed under the name "core" in the
current directory will break with this change. Given how questionnable this
behaviour is, and given that no common distro makes use of this by default it
shouldn't be too much of a loss. Also, the old behaviour may be restored by
explicitly configuring a "core_pattern" of "core", and setting the default
system RLIMIT_CORE to 0 again via system.conf.
src/core/main.c