From 17087340c3ad0f948033da3f07e4ff97af9bdd27 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 24 May 2019 22:22:21 +0900 Subject: [PATCH 1/3] journalctl: fix error cause in log message If varlink_call() returns negative errno, then `error` is null. --- src/journal/journalctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 91a21e407f..7d5b115c71 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1955,7 +1955,10 @@ static int simple_varlink_call(const char *option, const char *method) { r = varlink_call(link, method, NULL, NULL, &error, NULL); if (r < 0) - return log_error_errno(r, "Failed to execute varlink call: %s", error); + return log_error_errno(r, "Failed to execute varlink call: %m"); + if (error) + return log_error_errno(SYNTHETIC_ERRNO(ENOANO), + "Failed to execute varlink call: %s", error); return 0; } From f2083c718bf6928f15392297823873f58bc5aa45 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 28 May 2019 05:17:27 +0900 Subject: [PATCH 2/3] journalctl: mention --smart-relinquish-var in log message --- src/journal/journalctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 7d5b115c71..b7c378eaa9 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1968,7 +1968,7 @@ static int flush_to_var(void) { } static int relinquish_var(void) { - return simple_varlink_call("--relinquish-var", "io.systemd.Journal.RelinquishVar"); + return simple_varlink_call("--relinquish-var/--smart-relinquish-var", "io.systemd.Journal.RelinquishVar"); } static int rotate(void) { From 0bd3c2102f5eea4b4a3c780437b9af978aca36b6 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 24 May 2019 22:32:08 +0900 Subject: [PATCH 3/3] journalctl: make 'journalctl --flush' or friends not fail with varlink timeout Closes #12570. --- src/journal/journalctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b7c378eaa9..3d053c59f0 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1952,6 +1952,7 @@ static int simple_varlink_call(const char *option, const char *method) { return log_error_errno(r, "Failed to connect to /run/systemd/journal/io.systemd.journal: %m"); (void) varlink_set_description(link, "journal"); + (void) varlink_set_relative_timeout(link, USEC_INFINITY); r = varlink_call(link, method, NULL, NULL, &error, NULL); if (r < 0)