From 2f9cad927c01e4fe4be56dd101deac21fa167b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MARQUET?= Date: Fri, 29 Mar 2024 11:15:53 +0100 Subject: [PATCH] Put the monitoring after the start of all the sub programs --- startup.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/startup.sh b/startup.sh index 5ad402b..83813b4 100644 --- a/startup.sh +++ b/startup.sh @@ -4,21 +4,6 @@ # All the programs are called with their needed arguments # Author: Félix MARQUET -# Fonction pour surveiller la fermeture de l'IHM -monitor_ihm() { - while pgrep -x "ihm" > /dev/null; do - sleep 1 - done - # Une fois l'IHM fermée, tuer tous les autres programmes - killall tcp-server - killall lidar - killall camera - echo "All programs terminated." -} - -# Démarrer la fonction de surveillance en arrière-plan -monitor_ihm & - # Démarrer le serveur TCP echo "Starting the TCP server" /home/modelec/serge/tcp-server & @@ -37,5 +22,20 @@ echo "Starting the camera" echo "Starting the IHM" /home/modelec/serge/ihm fullscreen & +# Fonction pour surveiller la fermeture de l'IHM +monitor_ihm() { + while pgrep -x "ihm" > /dev/null; do + sleep 1 + done + # Une fois l'IHM fermée, tuer tous les autres programmes + killall tcp-server + killall lidar + killall camera + echo "All programs terminated." +} + +# Démarrer la fonction de surveillance en arrière-plan +monitor_ihm & + # Attendre que tous les programmes se terminent wait