代码拉取完成,页面将自动刷新
同步操作将从 yangshicheng/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From dc331f4c9268d17a66f4393cfd0dba14c7022d41 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
Date: Wed, 4 Aug 2021 11:20:07 +0200
Subject: [PATCH] journalctl: never fail at flushing when the flushed flag is
set
Even if journald was not running, flushing the volatile journal used to work if
the journal was already flushed (ie the flushed flag
/run/systemd/journald/flushed was created).
However since commit 4f413af2a0a, this behavior changed and now '--flush' fails
because it tries to contact journald without checking the presence of the
flushed flag anymore.
This patch restores the previous behavior since there's no reason to fail when
journalctl can figure out that the flush is not necessary.
(cherry picked from commit f6fca35e642a112e80cc9bddb9a2b4805ad40df2)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/dc331f4c9268d17a66f4393cfd0dba14c7022d41
---
src/journal/journalctl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index c8fb726d42..3eac97510d 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -2074,6 +2074,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");
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。