|
|
36e8a3 |
From af43906bb0c8f2bb3b135d68d56ea2fa58fa9e60 Mon Sep 17 00:00:00 2001
|
|
|
36e8a3 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
|
36e8a3 |
Date: Wed, 5 Dec 2018 17:33:15 +0100
|
|
|
36e8a3 |
Subject: [PATCH] coredump: remove duplicate MESSAGE= prefix from message
|
|
|
36e8a3 |
|
|
|
36e8a3 |
systemd-coredump[9982]: MESSAGE=Process 771 (systemd-journal) of user 0 dumped core.
|
|
|
36e8a3 |
systemd-coredump[9982]: Coredump diverted to /var/lib/systemd/coredump/core...
|
|
|
36e8a3 |
|
|
|
36e8a3 |
log_dispatch() calls log_dispatch_internal() which calls write_to_journal()
|
|
|
36e8a3 |
which appends MESSAGE= on its own.
|
|
|
36e8a3 |
|
|
|
36e8a3 |
(cherry-picked from commit 4f62556d71206ac814a020a954b397d4940e14c3)
|
|
|
36e8a3 |
|
|
|
36e8a3 |
Related: #1664976
|
|
|
36e8a3 |
---
|
|
|
36e8a3 |
src/coredump/coredump.c | 5 +++--
|
|
|
36e8a3 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
36e8a3 |
|
|
|
36e8a3 |
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
|
|
|
36e8a3 |
index 20a1cbdd4..d7dd81c1b 100644
|
|
|
36e8a3 |
--- a/src/coredump/coredump.c
|
|
|
36e8a3 |
+++ b/src/coredump/coredump.c
|
|
|
36e8a3 |
@@ -789,9 +789,10 @@ log:
|
|
|
36e8a3 |
return log_oom();
|
|
|
36e8a3 |
|
|
|
36e8a3 |
if (journald_crash) {
|
|
|
36e8a3 |
- /* We cannot log to the journal, so just print the MESSAGE.
|
|
|
36e8a3 |
+ /* We cannot log to the journal, so just print the message.
|
|
|
36e8a3 |
* The target was set previously to something safe. */
|
|
|
36e8a3 |
- log_dispatch(LOG_ERR, 0, core_message);
|
|
|
36e8a3 |
+ assert(startswith(core_message, "MESSAGE="));
|
|
|
36e8a3 |
+ log_dispatch(LOG_ERR, 0, core_message + strlen("MESSAGE="));
|
|
|
36e8a3 |
return 0;
|
|
|
36e8a3 |
}
|
|
|
36e8a3 |
|