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
This commit is contained in:
Athanasios Voutsadakis
2019-01-23 16:23:58 +00:00
parent fa4cff5eb7
commit 3528aab25b

View File

@@ -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
}