We have three states: - ENABLE_COREDUMP and systemd-coredump is installed, - ENABLE_COREDUMP but systemd-coredump is not installed, - !ENABLE_COREDUMP. In the last case we would not do any coredumping-related setup in pid1, which means that coredumps would go to to the working directory of the process, but actually limits are set to 0. This is inherited by children of pid1. As discussed extensively in https://github.com/systemd/systemd/pull/26607, this default is bad: dumps are written to arbitrary directories and not cleaned up. Nevertheless, the kernel cannot really fix it. It doesn't know where to write, and it doesn't know when that place would become available. It is only the userspace that can tell this to the kernel. So the only sensible change in the kernel would be to default to '|/bin/false', i.e. do what we do now. In the middle case, we disabled writing of coredumps via a pattern, but raise the RLIMIT_CORE. We need to raise the limit because we can't raise it later after processes have been forked off. This means we behave correctly, but allow coredumping to be enabled at a later point without a reboot. This patch makes the last case behave like the middle case. This means that even if systemd is compiled with systemd-coredump, it still does the usual setup. If users want to restore the kernel default, they need to provide two drop-in files: for sysctl.d, with 'kernel.core_pattern=core' for systemd.conf, with 'DefaultLimitCORE=0'. The general idea is that pid1 does the safe thing. A distro may want to use something different than the systemd-coredump machinery, and then that would could packaged together with the drop-ins to change the configuration. Alternative-for: #26607
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Code Map for information about this repository's layout and content.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.
