From 7aaa02a87e657bfa5f8b575977c9ea3bd9e19b1b Mon Sep 17 00:00:00 2001 From: Marko Bocevski Date: Tue, 22 Dec 2020 00:15:16 +0100 Subject: [PATCH] Exit CKAN startup if prerun exits --- images/ckan/2.7/setup/app/start_ckan.sh | 2 +- images/ckan/2.8/setup/app/start_ckan.sh | 2 +- images/ckan/2.9/setup/app/start_ckan.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/images/ckan/2.7/setup/app/start_ckan.sh b/images/ckan/2.7/setup/app/start_ckan.sh index 95b4ad5..a0bc80d 100755 --- a/images/ckan/2.7/setup/app/start_ckan.sh +++ b/images/ckan/2.7/setup/app/start_ckan.sh @@ -16,7 +16,7 @@ fi UWSGI_OPTS="--socket /tmp/uwsgi.sock --uid 92 --gid 92 --http :5000 --master --enable-threads --paste config:/srv/app/production.ini --paste-logger /srv/app/production.ini --lazy-apps --gevent 2000 -p 2 -L --gevent-early-monkey-patch" # Run the prerun script to init CKAN and create the default admin user -python prerun.py +python prerun.py || { echo '[CKAN prerun] FAILED. Exiting...' ; exit 1; } # Check if we are in maintenance mode and if yes serve the maintenance pages if [ "$MAINTENANCE_MODE" = true ]; then PYTHONUNBUFFERED=1 python maintenance/serve.py; fi diff --git a/images/ckan/2.8/setup/app/start_ckan.sh b/images/ckan/2.8/setup/app/start_ckan.sh index 95b4ad5..a0bc80d 100755 --- a/images/ckan/2.8/setup/app/start_ckan.sh +++ b/images/ckan/2.8/setup/app/start_ckan.sh @@ -16,7 +16,7 @@ fi UWSGI_OPTS="--socket /tmp/uwsgi.sock --uid 92 --gid 92 --http :5000 --master --enable-threads --paste config:/srv/app/production.ini --paste-logger /srv/app/production.ini --lazy-apps --gevent 2000 -p 2 -L --gevent-early-monkey-patch" # Run the prerun script to init CKAN and create the default admin user -python prerun.py +python prerun.py || { echo '[CKAN prerun] FAILED. Exiting...' ; exit 1; } # Check if we are in maintenance mode and if yes serve the maintenance pages if [ "$MAINTENANCE_MODE" = true ]; then PYTHONUNBUFFERED=1 python maintenance/serve.py; fi diff --git a/images/ckan/2.9/setup/app/start_ckan.sh b/images/ckan/2.9/setup/app/start_ckan.sh index 3dc0046..fee6dad 100755 --- a/images/ckan/2.9/setup/app/start_ckan.sh +++ b/images/ckan/2.9/setup/app/start_ckan.sh @@ -16,7 +16,7 @@ fi UWSGI_OPTS="--socket /tmp/uwsgi.sock --uid ckan --gid ckan --http :5000 --master --enable-threads --wsgi-file /srv/app/wsgi.py --module wsgi:application --lazy-apps --gevent 2000 -p 2 -L --gevent-early-monkey-patch --vacuum --harakiri 50 --callable application" # Run the prerun script to init CKAN and create the default admin user -python prerun.py +python prerun.py || { echo '[CKAN prerun] FAILED. Exiting...' ; exit 1; } # Check if we are in maintenance mode and if yes serve the maintenance pages if [ "$MAINTENANCE_MODE" = true ]; then PYTHONUNBUFFERED=1 python maintenance/serve.py; fi