summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch
blob: 7ed358bfe37a329081e3992fa2184b1bae6aab96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sat, 27 Feb 2016 12:27:06 +0100
Subject: Revert "core: set RLIMIT_CORE to unlimited by default"

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
---
 src/core/main.c              | 2 --
 sysctl.d/50-coredump.conf.in | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/core/main.c b/src/core/main.c
index a280b75..5c2a73a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -2669,8 +2669,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");
diff --git a/sysctl.d/50-coredump.conf.in b/sysctl.d/50-coredump.conf.in
index 4338756..8e501c4 100644
--- a/sysctl.d/50-coredump.conf.in
+++ b/sysctl.d/50-coredump.conf.in
@@ -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
 
 # Allow that 16 coredumps are dispatched in parallel by the kernel. We want to
 # be able to collect process metadata from /proc/%P/ while processing