- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
76 lines
2.3 KiB
Python
76 lines
2.3 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Arrête le serveur de développement.
|
|
"""
|
|
|
|
import os
|
|
import json
|
|
import signal
|
|
from pathlib import Path
|
|
|
|
def stop_dev_server():
|
|
"""Arrête le serveur de développement"""
|
|
print("🛑 === ARRÊT SERVEUR DÉVELOPPEMENT ===")
|
|
|
|
info_file = Path("dev_server_info.json")
|
|
if not info_file.exists():
|
|
print("❌ Fichier dev_server_info.json non trouvé")
|
|
print(" Le serveur n'est peut-être pas démarré ou a été arrêté manuellement")
|
|
return False
|
|
|
|
try:
|
|
with open(info_file, 'r') as f:
|
|
info = json.load(f)
|
|
|
|
pid = info.get("pid")
|
|
port = info.get("port")
|
|
temp_script = info.get("temp_script")
|
|
|
|
print(f"📋 Informations serveur:")
|
|
print(f" PID: {pid}")
|
|
print(f" Port: {port}")
|
|
print(f" Démarré: {info.get('started_at', 'N/A')}")
|
|
|
|
# Arrêter le processus
|
|
if pid:
|
|
try:
|
|
os.kill(pid, signal.SIGTERM)
|
|
print(f"✅ Processus {pid} arrêté")
|
|
except ProcessLookupError:
|
|
print(f"⚠️ Processus {pid} déjà arrêté")
|
|
except PermissionError:
|
|
print(f"❌ Permission refusée pour arrêter le processus {pid}")
|
|
return False
|
|
|
|
# Nettoyer le script temporaire
|
|
if temp_script:
|
|
temp_path = Path(temp_script)
|
|
if temp_path.exists():
|
|
try:
|
|
temp_path.unlink()
|
|
print(f"✅ Script temporaire supprimé: {temp_script}")
|
|
except Exception as e:
|
|
print(f"⚠️ Erreur suppression script temporaire: {e}")
|
|
|
|
# Supprimer le fichier d'informations
|
|
info_file.unlink()
|
|
print("✅ Fichier d'informations supprimé")
|
|
|
|
print("\\n🎉 Serveur de développement arrêté avec succès")
|
|
return True
|
|
|
|
except Exception as e:
|
|
print(f"❌ Erreur lecture fichier d'informations: {e}")
|
|
return False
|
|
|
|
def main():
|
|
"""Arrêt du serveur"""
|
|
if not stop_dev_server():
|
|
print("❌ Échec de l'arrêt du serveur")
|
|
return False
|
|
|
|
return True
|
|
|
|
if __name__ == "__main__":
|
|
success = main()
|
|
exit(0 if success else 1) |