From 3528aab25ba17c4fc38c7d38170c1bdcc80efc7a Mon Sep 17 00:00:00 2001 From: Athanasios Voutsadakis Date: Wed, 23 Jan 2019 16:23:58 +0000 Subject: [PATCH] Kill the other processes started by the script We use exec to start awslogs_agent and then a tail to print logs to stdout. CF docs[1] recommend to use exec to start processes which seems to imply that as long as there are commands running the container will remain up and running. This commit ensures that if there are no celery tasks running we will kill any other processes that we have started, so that the container will no longer be considered healthy by cloudfoundry and will be replaced. 1: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#start-commands --- scripts/run_multi_worker_app_paas.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/run_multi_worker_app_paas.sh b/scripts/run_multi_worker_app_paas.sh index b44ab28d3..6824923ea 100755 --- a/scripts/run_multi_worker_app_paas.sh +++ b/scripts/run_multi_worker_app_paas.sh @@ -113,6 +113,10 @@ function ensure_celery_is_running { sleep 15 + echo "Killing awslogs_agent and tail" + kill -9 ${AWSLOGS_AGENT_PID} + kill -9 ${LOGS_TAIL_PID} + exit 1 fi }