Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supervisor to run-lokole.sh #455

Open
c-w opened this issue May 11, 2020 · 0 comments
Open

Add supervisor to run-lokole.sh #455

c-w opened this issue May 11, 2020 · 0 comments

Comments

@c-w
Copy link
Member

c-w commented May 11, 2020

Currently we're using Bash process monitoring to supervise the various parts of the Lokole client application that run in Docker:

"${scriptdir}/run-celery.sh" &
celery_pid="$!"
"${scriptdir}/run-crontab.sh" &
crontab_pid="$!"
"${scriptdir}/run-gunicorn.sh" &
gunicorn_pid="$!"
while :; do
if [[ ! -e "/proc/${celery_pid}" ]]; then
echo "celery crashed" >&2
exit 1
elif [[ ! -e "/proc/${crontab_pid}" ]]; then
echo "crontab crashed" >&2
exit 2
elif [[ ! -e "/proc/${gunicorn_pid}" ]]; then
echo "gunicorn crashed" >&2
exit 3
else
sleep 10
fi
done

We should replace this with supervisord so that the Dockerized runtime is consistent with the runtime set up by install.py.

Note that supervisord isolates environment variables so we'll need to ensure that all LOKOLE_ and OPWEN_ environment variables in the Docker environment are correctly passed down to the supervisor processes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant