Follow-up for
e5d60d1b3b0c0b229571823c7fdd390a9562982e.
The current system journal's seqnum ID will usually be different from
the seqnum ID of the current runtime journal. Therefore, to avoid
unnecessary rotations on boot, reset the runtime seqnum data when
switching to system journal so that systemd-journald will adopt the
system journal's seqnum ID and value on next write.
Fixes #30092
#include "journald-stream.h"
#include "journald-syslog.h"
#include "log.h"
+#include "memory-util.h"
#include "missing_audit.h"
#include "mkdir.h"
#include "parse-util.h"
if (!s->system_journal)
return 0;
+ /* Reset current seqnum data to avoid unnecessary rotation when switching to system journal.
+ * See issue #30092. */
+ zero(*s->seqnum);
+
log_debug("Flushing to %s...", s->system_storage.path);
start = now(CLOCK_MONOTONIC);