Revert "core: set RLIMIT_CORE to unlimited by default"
authorMartin Pitt <martin.pitt@ubuntu.com>
Sat, 27 Feb 2016 11:27:06 +0000 (12:27 +0100)
committerMichael Biebl <biebl@debian.org>
Mon, 21 Sep 2020 18:28:36 +0000 (19:28 +0100)
Partially revert commit 15a900327ab as this completely breaks core dumps
without systemd-coredump. It's also contradicting core(8), and it's not
systemd's place to redefine the kernel definitions of core files.

Commit bdfd7b2c now honours the process' RLIMIT_CORE for systemd-coredump. This
isn't what RLIMIT_CORE is supposed to do (it limits the size of the core
*file*, but the kernel deliberately ignores it for piping), so set a static
2^63 core size limit for systemd-coredump to go back to the previous behaviour
(otherwise the change above would break systemd-coredump).

Bug-Debian: https://bugs.debian.org/815020

Gbp-Pq: Topic debian
Gbp-Pq: Name Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch

src/core/main.c
sysctl.d/50-coredump.conf.in

index 9a834a875e8f239cf5ef2f559e06b539196f05ad..2fb0e952360229a955e6137164d3f9f281faf09e 100644 (file)
@@ -2660,8 +2660,6 @@ int main(int argc, char *argv[]) {
                         kernel_timestamp = DUAL_TIMESTAMP_NULL;
                 }
 
-                initialize_coredump(skip_setup);
-
                 r = fixup_environment();
                 if (r < 0) {
                         log_emergency_errno(r, "Failed to fix up PID 1 environment: %m");
index da76fd71d6a2e3da0602bcc4fafc6e4f8251fc5f..53e48feb559f8fdf974db9852f105bf626115821 100644 (file)
@@ -13,7 +13,7 @@
 # the core dump.
 #
 # See systemd-coredump(8) and core(5).
-kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %P %u %g %s %t %c %h
+kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %P %u %g %s %t 9223372036854775808 %h
 
 # Also dump processes executing a set-user-ID/set-group-ID program that is
 # owned by a user/group other than the real user/group ID of the process, or