From 4da7d867f237542aadac148eebbcff60f82d9ef9 Mon Sep 17 00:00:00 2001 From: Sven van Ginkel Date: Sun, 11 Oct 2026 19:02:38 +0200 Subject: [PATCH] systemd: include user journals in service logs (#2553) --- agent/systemd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/systemd.go b/agent/systemd.go index 7b3c2964..d24d7791 100644 --- a/agent/systemd.go +++ b/agent/systemd.go @@ -374,7 +374,10 @@ func (sm *systemdManager) getServiceLogs(serviceName string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), 2100*time.Millisecond) defer cancel() - cmd := exec.CommandContext(ctx, "journalctl", "--system", "--quiet", "--no-pager", "--output=short-iso", "--unit", unitName, "--lines", strconv.Itoa(systemdLogsTail)) + // No --system: journald (SplitMode=uid) stores output from services running + // as a non-system User= in user-UID.journal, which --system excludes. + // --unit still restricts results to the system unit. + cmd := exec.CommandContext(ctx, "journalctl", "--quiet", "--no-pager", "--output=short-iso", "--unit", unitName, "--lines", strconv.Itoa(systemdLogsTail)) output := limitedBuffer{limit: maxTotalLogSize} cmd.Stdout = &output stderr := limitedBuffer{limit: 1024}