show logs in Gitea even with the service is runs as --user

This commit is contained in:
Mark Eaton
2026-01-24 23:06:59 -05:00
parent 6641b62415
commit 3286b9618e
+5 -1
View File
@@ -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}"