From 5a81907a0e1997a9810c61eebb67e543f646963a Mon Sep 17 00:00:00 2001 From: Jules Date: Fri, 26 Jun 2026 19:49:51 +0200 Subject: [PATCH] Kiosk : flag maintenance + anti-doublon backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check /tmp/photobooth-maintenance pour bloquer le restart loop - Vérifie qu'aucun backend ne tourne avant d'en lancer un nouveau Co-Authored-By: Claude Opus 4.6 --- scripts/kiosk-session.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/kiosk-session.sh b/scripts/kiosk-session.sh index c7f8500..6af9652 100755 --- a/scripts/kiosk-session.sh +++ b/scripts/kiosk-session.sh @@ -24,6 +24,14 @@ sleep 1 # Backend en boucle : redémarre automatiquement s'il plante _backend_loop() { while true; do + # Mode maintenance : attendre la fin de l'intervention + while [ -f /tmp/photobooth-maintenance ]; do sleep 2; done + # Vérifier qu'aucun autre backend ne tourne (éviter les doublons) + if pgrep -f "python.*backend.main" > /dev/null 2>&1; then + echo "[kiosk] backend déjà en cours, attente..." + sleep 5 + continue + fi cd /home/jules/photobooth # Mise à jour automatique depuis Gitea git pull --ff-only 2>&1 | logger -t photobooth-git