From d0cd1fe11f485c83c9a3b5e5e50101c6e24b47f3 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Thu, 10 Mar 2016 18:40:28 +0100 Subject: [PATCH] fix race --- installer/bin/update-images.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/installer/bin/update-images.sh b/installer/bin/update-images.sh index 34f456fd..fa594aa3 100755 --- a/installer/bin/update-images.sh +++ b/installer/bin/update-images.sh @@ -32,9 +32,12 @@ done # We do not want to get interrupted by a check touch /var/run/check.lock -# Delete all T-Pot upstart scripts +# Stop T-Pot services and delete all T-Pot upstart scripts +echo "### Stopping T-Pot services and cleaning up." for i in $(ls /data/upstart/); do + service $i stop + sleep 2 rm -rf /etc/init/$i || true; done @@ -45,12 +48,12 @@ for i in $(cat /data/images.conf); cp /data/upstart/"$i".conf /etc/init/; done -# Allow checks to resume -rm /var/run/check.lock - # Announce reboot echo "### Rebooting in 60 seconds for the changes to take effect." sleep 60 +# Allow checks to resume +rm /var/run/check.lock + # Reboot reboot