From 9d200b92f7107cc019f69915821b448bfb4210b6 Mon Sep 17 00:00:00 2001 From: Roby Date: Sun, 26 Apr 2026 12:43:15 +0200 Subject: [PATCH] update --- install.txt | 31 +++++++++++++++++++++---------- systemd/fleet-control.service | 6 ++++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/install.txt b/install.txt index d9a1e62..268113a 100644 --- a/install.txt +++ b/install.txt @@ -51,12 +51,17 @@ They will NOT work over standard HTTP. ------------------------------------------------------------ 4. RUNNING AS A SERVICE (SYSTEMD) ------------------------------------------------------------ -NOTE: Make sure your fleet-console.service file points to -the executable inside the venv (e.g., ExecStart=/opt/web-control-server/venv/bin/gunicorn ...) +⚠️ IMPORTANT (VENV USERS): Before copying the service file, +open 'fleet-control.service' and ensure the paths point to your +virtual environment. + +Example: +WorkingDirectory=/opt/web-control-server +ExecStart=/opt/web-control-server/venv/bin/gunicorn -k ... Configuration: 1. Copy .service file to '/etc/systemd/system/': - sudo cp fleet-console.service /etc/systemd/system/ + sudo cp fleet-control.service /etc/systemd/system/ 2. Reload systemd: sudo systemctl daemon-reload 3. Enable on boot: sudo systemctl enable fleet-console 4. Start service: sudo systemctl start fleet-console @@ -106,12 +111,18 @@ Passaggi: 3. Imposta 'vapid_claim_email' (es. "mailto:tua@email.com"). ------------------------------------------------------------ -4. ESECUZIONE COME SERVIZIO +4. ESECUZIONE COME SERVIZIO (SYSTEMD) ------------------------------------------------------------ -NOTA BENE: Assicurati che il file fleet-console.service -punti all'eseguibile dentro il venv (es: ExecStart=/opt/web-control-server/venv/bin/gunicorn ...) +⚠️ IMPORTANTE (PER UTENTI VENV): Prima di copiare il file di +servizio, apri 'fleet-control.service' e assicurati che i percorsi +puntino al tuo ambiente virtuale! -1. sudo cp fleet-console.service /etc/systemd/system/ -2. sudo systemctl daemon-reload -3. sudo systemctl enable fleet-console -4. sudo systemctl start fleet-console +Esempio: +WorkingDirectory=/opt/web-control-server +ExecStart=/opt/web-control-server/venv/bin/gunicorn -k ... + +Passaggi: +1. Copia il file in systemd: sudo cp fleet-control.service /etc/systemd/system/ +2. Ricarica la configurazione: sudo systemctl daemon-reload +3. Abilita all'avvio: sudo systemctl enable fleet-console +4. Avvia il servizio: sudo systemctl start fleet-console diff --git a/systemd/fleet-control.service b/systemd/fleet-control.service index d00d798..4b83ed3 100644 --- a/systemd/fleet-control.service +++ b/systemd/fleet-control.service @@ -5,8 +5,10 @@ After=network.target [Service] Type=simple User=root -WorkingDirectory=/opt/web-control -ExecStart=/usr/local/bin/gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --graceful-timeout 2 --bind 0.0.0.0:9000 app:app +# Assicurati che questo sia il percorso esatto della cartella del tuo progetto +WorkingDirectory=/opt/web-control-server +# PUNTA AL GUNICORN DENTRO IL VENV! +ExecStart=/opt/web-control-server/venv/bin/gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" -w 1 --graceful-timeout 2 --bind 0.0.0.0:9000 app:app TimeoutStopSec=3 Restart=always RestartSec=5