]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl-show: report VARLINKERROR=
authorMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:56:02 +0000 (22:56 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 13 May 2025 20:57:29 +0000 (22:57 +0200)
Who knows, maybe one day we'd support spawning journalctl
as varlink socket-activatable service, where this bit of
info would help.

src/journal/journalctl-show.c

index 20b39da62de40b5844be8cd6a7aec3b66352b5e4..eac93b222d4670db4d915eaf9ca4bf3d48df949a 100644 (file)
@@ -350,8 +350,10 @@ static int on_synchronize_reply(
 
         assert(vl);
 
-        if (error_id)
+        if (error_id) {
                 log_warning("Failed to synchronize on Journal, ignoring: %s", error_id);
+                (void) sd_notifyf(/* unset_environment= */ false, "VARLINKERROR=%s", error_id);
+        }
 
         r = show_and_fflush(c);
         if (r < 0)
@@ -377,7 +379,7 @@ static int on_signal(sd_event_source *s, const struct signalfd_siginfo *si, void
 
         r = varlink_connect_journal(&vl);
         if (r < 0) {
-                log_error_errno(r, "Failed to connect to Journal Varlink IPC interface, ignoring: %m");
+                log_error_errno(r, "Failed to connect to Journal Varlink IPC interface, skipping synchronization: %m");
                 goto finish;
         }