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`
This commit is contained in:
Athanasios Voutsadakis
2018-02-28 14:16:15 +00:00
parent 9a8e771d95
commit bef80e3414

View File

@@ -81,7 +81,7 @@ function get_celery_pids {
}
function start_application {
exec "$@"
eval "$@"
get_celery_pids
echo "Application process pids: ${APP_PIDS}"
}