diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:49:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:49:53 +0000 |
commit | 87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68 (patch) | |
tree | 263fc56d7d40512aaa09193905008a3f4e3b0018 /debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch | |
parent | Adding upstream version 255.4. (diff) | |
download | systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.tar.xz systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.zip |
Adding debian version 255.4-1.debian/255.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch')
-rw-r--r-- | debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch b/debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch new file mode 100644 index 0000000..267c2b4 --- /dev/null +++ b/debian/patches/debian/Revert-core-set-RLIMIT_CORE-to-unlimited-by-default.patch @@ -0,0 +1,69 @@ +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 | 18 ------------------ + sysctl.d/50-coredump.conf.in | 2 +- + 2 files changed, 1 insertion(+), 19 deletions(-) + +diff --git a/src/core/main.c b/src/core/main.c +index 3f71cc0..876c7d5 100644 +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -1653,22 +1653,6 @@ static void cmdline_take_random_seed(void) { + "This functionality should not be used outside of testing environments."); + } + +-static void initialize_coredump(bool skip_setup) { +- if (getpid_cached() != 1) +- return; +- +- /* Don't limit the core dump size, so that coredump handlers such as systemd-coredump (which honour +- * the limit) will process core dumps for system services by default. */ +- if (setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY)) < 0) +- log_warning_errno(errno, "Failed to set RLIMIT_CORE: %m"); +- +- /* But at the same time, turn off the core_pattern logic by default, so that no coredumps are stored +- * until the systemd-coredump tool is enabled via sysctl. However it can be changed via the kernel +- * command line later so core dumps can still be generated during early startup and in initrd. */ +- if (!skip_setup) +- disable_coredumps(); +-} +- + static void initialize_core_pattern(bool skip_setup) { + int r; + +@@ -2922,8 +2906,6 @@ int main(int argc, char *argv[]) { + kernel_timestamp = DUAL_TIMESTAMP_NULL; + } + +- initialize_coredump(skip_setup); +- + r = fixup_environment(); + if (r < 0) { + log_struct_errno(LOG_EMERG, r, +diff --git a/sysctl.d/50-coredump.conf.in b/sysctl.d/50-coredump.conf.in +index 90c080b..1730841 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=|{{LIBEXECDIR}}/systemd-coredump %P %u %g %s %t %c %h ++kernel.core_pattern=|{{LIBEXECDIR}}/systemd-coredump %P %u %g %s %t 9223372036854775808 %h + + # Allow 16 coredumps to be dispatched in parallel by the kernel. + # We collect metadata from /proc/%P/, and thus need to make sure the crashed |