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}"