====== Runbook: Avviare/arrestare server ====== **Durata:** ~5 minuti \\ **Ruolo:** Operatore Gateway \\ **Prerequisito:** Diritti di amministratore ---- ===== Workflow ===== flowchart TD A[Start] --> B{Gia in esecuzione?} B -->|Si| C[Arrestare] B -->|No| D[Avviare] C --> D D --> E[Health Check] E --> F{Riuscito?} F -->|Si| G[Finito] F -->|No| H[Controllare log] H --> D style G fill:#e8f5e9 style H fill:#ffebee ---- ===== 1. Verificare stato ===== **Windows:** # Cercare processo Get-Process -Name "WvdS.WebAPI.Data.Gateway.Api" -ErrorAction SilentlyContinue # Oppure via porta netstat -ano | findstr :5000 **Linux:** # Cercare processo pgrep -f "WvdS.WebAPI.Data.Gateway.Api" # Oppure via porta ss -tlnp | grep 5000 ---- ===== 2. Avviare server ===== **Windows (Console):** cd %GATEWAY_ROOT% .\WvdS.WebAPI.Data.Gateway.Api.exe **Windows (Background):** Start-Process -FilePath "%GATEWAY_ROOT%\WvdS.WebAPI.Data.Gateway.Api.exe" -WindowStyle Hidden **Linux:** cd /opt/gateway ./WvdS.WebAPI.Data.Gateway.Api & ---- ===== 3. Arrestare server ===== **Windows:** # Graceful shutdown Stop-Process -Name "WvdS.WebAPI.Data.Gateway.Api" -Force **Linux:** # Graceful shutdown pkill -SIGTERM -f "WvdS.WebAPI.Data.Gateway.Api" # Force kill (solo se necessario) pkill -9 -f "WvdS.WebAPI.Data.Gateway.Api" ---- ===== 4. Health Check ===== # Verificare disponibilita curl -s http://localhost:5000/health # Risposta attesa: "Healthy" ---- ===== 5. Checklist ===== | # | Punto di verifica | v | |---|-----------|---| | 1 | Processo in esecuzione | ☐ | | 2 | Porta 5000 aperta | ☐ | | 3 | Health Check "Healthy" | ☐ | | 4 | Nessun errore in console | ☐ | ---- ===== Troubleshooting ===== | Problema | Causa | Soluzione | |---------|---------|--------| | ''Porta gia in uso'' | Vecchio processo attivo | Terminare processo, poi avviare | | ''Access denied'' | Diritti mancanti | Avviare come amministratore | | ''Config error'' | appsettings.json errato | Verificare sintassi JSON | | ''Database connection failed'' | DSN configurato male | Verificare Connection String | ---- ===== Runbook Correlati ===== * [[.:health-check|Health Check]] - Verifica stato dettagliata * [[.:logs-pruefen|Controllare log]] - Analisi errori * [[..:automatisierung:windows-dienst|Servizio Windows]] - Eseguire come servizio ---- << [[.:start|<- Attivita Quotidiane]] | [[.:dsn-verwalten|-> Gestire DSN]] >> ---- //Wolfgang van der Stille @ EMSR DATA d.o.o. - Data Gateway Professional// {{tag>operator runbook server avviare arrestare}}