From 3286b9618e6a0c831948b1eee69ce9920ccc304b Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Sat, 24 Jan 2026 23:06:59 -0500 Subject: [PATCH] show logs in Gitea even with the service is runs as --user --- notify/notify-gitea.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notify/notify-gitea.sh b/notify/notify-gitea.sh index 03df77d..4e201e0 100755 --- a/notify/notify-gitea.sh +++ b/notify/notify-gitea.sh @@ -39,7 +39,11 @@ if [[ "$STATUS" == "success" ]]; then fi # Get recent logs for context (last 20 lines) -RECENT_LOGS=$(journalctl -u "$SERVICE_NAME" -n 20 --no-pager 2>/dev/null || echo "No logs available") +# Try system journal first, fall back to user journal +RECENT_LOGS=$(journalctl -u "$SERVICE_NAME" -n 100 --no-pager 2>/dev/null) +if [[ -z "$RECENT_LOGS" || "$RECENT_LOGS" == *"-- No entries --"* ]]; then + RECENT_LOGS=$(journalctl --user-unit "$SERVICE_NAME" -n 100 --no-pager 2>/dev/null || echo "No logs available") +fi # Build issue title and body TITLE="[${HOSTNAME}] Service failure: ${SERVICE_NAME}"