diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 4a2343a63dd..73e4fafdffd 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2064,6 +2064,11 @@ static int simple_varlink_call(const char *option, const char *method) { } static int flush_to_var(void) { + if (access("/run/systemd/journal/flushed", F_OK) >= 0) + return 0; /* Already flushed, no need to contact journald */ + if (errno != ENOENT) + return log_error_errno(errno, "Unable to check for existence of /run/systemd/journal/flushed: %m"); + return simple_varlink_call("--flush", "io.systemd.Journal.FlushToVar"); }