Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions prod-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ say "Project directory: $PROJECT_DIR"
say "Running as: $(id -un) (uid=$(id -u) gid=$(id -g))"

ensure_service_user || true
if [[ "$SERVICE_USER" != "$APP_NAME" ]]; then
warn "Using fallback service identity ${SERVICE_USER}:${SERVICE_GROUP}; ownership/service behavior may differ from root-managed installs"
fi

# ---------------------------------------------------------
# 1) Git fetch + reset
Expand Down Expand Up @@ -535,6 +532,23 @@ else
PORT_STATUS="not-listening"
fi

SYSTEMD_ACTIVE="$(systemctl is-active "${APP_NAME}.service" 2>/dev/null || echo inactive)"
HEALTH_URL="$(resolve_health_url)"
HEALTH_PORT="${HEALTH_URL#*://127.0.0.1:}"
HEALTH_PORT="${HEALTH_PORT%%/*}"

if wait_for_health "$HEALTH_URL" 20 2; then
HEALTH_STATUS="healthy"
else
HEALTH_STATUS="unhealthy"
fi

if is_port_listening "$HEALTH_PORT"; then
PORT_STATUS="listening"
else
PORT_STATUS="not-listening"
fi

say "✔ Systemd service: ${SYSTEMD_ACTIVE}"
say "✔ Health URL: ${HEALTH_URL}"
say "✔ Health endpoint: ${HEALTH_STATUS}"
Expand Down
Loading