show logs in Gitea even with the service is runs as --user
This commit is contained in:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user