From 41a04e5b2d1d9324a1c26a3c5a6c44240fb1da7d Mon Sep 17 00:00:00 2001 From: Alec Turner Date: Fri, 8 Mar 2024 12:53:35 -0800 Subject: [PATCH] ensure stop is always called at the end of entry script interrupts were not properly handled by the entry script, and could leave containers active. This is fixed by running stop in a cleanup function, called on exit. --- .../clientapps/streamline/streamline-emr/entry | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/root/var/signalytic/clientapps/streamline/streamline-emr/entry b/root/var/signalytic/clientapps/streamline/streamline-emr/entry index 86f2f95e..66237eb5 100755 --- a/root/var/signalytic/clientapps/streamline/streamline-emr/entry +++ b/root/var/signalytic/clientapps/streamline/streamline-emr/entry @@ -2,6 +2,13 @@ LOCATION="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +function cleanup { + ${LOCATION}/stop + echo "done." +} + +trap cleanup EXIT + # start all instances ${LOCATION}/start @@ -15,6 +22,3 @@ for f in $(find ${LOCATION} -mindepth 2 -maxdepth 3 -name docker-compose.yml); d done echo "waiting on processes: ${pids[@]}" wait -n ${pids[@]} > /dev/null - -# cleanup -${LOCATION}/stop