summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-22 18:01:50 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-22 18:01:50 +0200
commit5157879b757bffce3da0a68ca207753569e8627d (patch)
tree654a4153613d59324fd2cb6180cbb680ee5f4c80
parent78f043f77b17299d3039e492e3661f4ca6d7f74e (diff)
coredump: turn off coredump collection entirely after journald or PID 1 crashed
Safe is safe, let's turn off the whole logic if we can, after all it is unlikely we'll be able to process further crashes in a reasonable way.
-rw-r--r--src/coredump/coredump.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index a75f364d2d..e5719e67c3 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -920,6 +920,9 @@ static int process_special_crash(const char *context[], int input_fd) {
log_notice("Detected coredump of the journal daemon or PID 1, diverted to %s.", filename);
+ log_notice("Due to the special circumstances, coredump collection will now be turned off.");
+ (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
+
return 0;
}