From 694d73d43c7741b1766ea6a5360e17860a940e93 Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Tue, 9 Aug 2022 16:50:52 +0200 Subject: [PATCH] Fix broken run-helper update syntax and run-helper not updating on restart (#2050) * Fix broken syntax in update wait for loop * Update run-helper after each restart, not only at first --- src/Misc/layoutroot/run-helper.sh.template | 4 ++-- src/Misc/layoutroot/run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Misc/layoutroot/run-helper.sh.template b/src/Misc/layoutroot/run-helper.sh.template index 42f11eb01..36ca2d94a 100755 --- a/src/Misc/layoutroot/run-helper.sh.template +++ b/src/Misc/layoutroot/run-helper.sh.template @@ -35,7 +35,7 @@ elif [[ $returnCode == 2 ]]; then elif [[ $returnCode == 3 ]]; then # Wait for 30 seconds or for flag file to exists for the runner update process finish echo "Runner listener exit because of updating, re-launch runner after successful update" - for i in {0..30} do + for i in {0..30}; do if test -f "$updateFile"; then echo "Update finished successfully." rm "$updateFile" @@ -47,7 +47,7 @@ elif [[ $returnCode == 3 ]]; then elif [[ $returnCode == 4 ]]; then # Wait for 30 seconds or for flag file to exists for the ephemeral runner update process finish echo "Runner listener exit because of updating, re-launch runner after successful update" - for i in {0..30} do + for i in {0..30}; do if test -f "$updateFile"; then echo "Update finished successfully." rm "$updateFile" diff --git a/src/Misc/layoutroot/run.sh b/src/Misc/layoutroot/run.sh index e0043ecfd..ca9e5247d 100755 --- a/src/Misc/layoutroot/run.sh +++ b/src/Misc/layoutroot/run.sh @@ -9,10 +9,10 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -cp -f "$DIR"/run-helper.sh.template "$DIR"/run-helper.sh # run the helper process which keep the listener alive while :; do + cp -f "$DIR"/run-helper.sh.template "$DIR"/run-helper.sh "$DIR"/run-helper.sh $* returnCode=$? if [[ $returnCode -eq 2 ]]; then