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}