From bef80e3414092ed5ef1d5fc68c1ce32ce726d748 Mon Sep 17 00:00:00 2001 From: Athanasios Voutsadakis Date: Wed, 28 Feb 2018 14:16:15 +0000 Subject: [PATCH] Use `eval` to run the command instead of exec `exec` is replacing the current shell to run the command, which means that the script execution stops at that line. Passing it to the background with `exec "$@" &` won't work either, because the script will move directly to the next command where it looks for the `.pid` files that have not yet been created because celery takes a few seconds to spin up all the processes. Using `sleep X` to remedy this seems just wrong given that 1. we can use `eval` that blocks until the command returns 2. there is no obvious benefit in sticking with `exec` --- scripts/run_multi_worker_app_paas.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_multi_worker_app_paas.sh b/scripts/run_multi_worker_app_paas.sh index d54e4bd83..191b1f564 100755 --- a/scripts/run_multi_worker_app_paas.sh +++ b/scripts/run_multi_worker_app_paas.sh @@ -81,7 +81,7 @@ function get_celery_pids { } function start_application { - exec "$@" + eval "$@" get_celery_pids echo "Application process pids: ${APP_PIDS}" }