ids.alfacom.it/deployment/check_frontend.sh
marco370 34d830b275 Replace custom scripts with systemd for managing backend and frontend services
Replace custom process management scripts (`check_backend.sh`, `check_frontend.sh`, `restart_all.sh`) with `systemctl` commands to ensure proper service management and virtual environment utilization.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 9aa98b1a-1ee1-47f9-a579-83bad5992ed1
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/MmMtYN7
2026-02-16 12:02:53 +00:00

29 lines
879 B
Bash
Executable File

#!/bin/bash
# =========================================================
# CHECK FRONTEND - Verifica e riavvia frontend Node.js se necessario
# Usa systemctl per gestire il servizio
# =========================================================
LOG_FILE="/var/log/ids/frontend.log"
mkdir -p /var/log/ids
# Check if systemd service is active
if systemctl is-active --quiet ids-frontend; then
exit 0
else
echo "[$(date)] Frontend Node NON attivo, riavvio via systemctl..." >> "$LOG_FILE"
# Restart via systemctl
systemctl restart ids-frontend
# Wait for startup
sleep 3
if systemctl is-active --quiet ids-frontend; then
echo "[$(date)] Frontend riavviato con successo via systemctl" >> "$LOG_FILE"
else
echo "[$(date)] ERRORE: Frontend non si è avviato. Controlla: journalctl -u ids-frontend" >> "$LOG_FILE"
fi
fi