From 0f5296d0272378dd9920adb9d5558a270a44b979 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 20 Jul 2019 14:34:59 +0200 Subject: [PATCH] small fixes in healthcheck and entrypoint script --- overlay/etc/services.d/.s6-svscan/crash | 4 ++++ overlay/etc/services.d/.s6-svscan/finish | 2 +- overlay/usr/local/bin/entrypoint.sh | 5 +++++ overlay/usr/local/bin/healthcheck.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 overlay/etc/services.d/.s6-svscan/crash mode change 100644 => 100755 overlay/etc/services.d/.s6-svscan/finish diff --git a/overlay/etc/services.d/.s6-svscan/crash b/overlay/etc/services.d/.s6-svscan/crash new file mode 100755 index 0000000..3c3a189 --- /dev/null +++ b/overlay/etc/services.d/.s6-svscan/crash @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +echo "Container crashed. Exiting..." +exit 1 diff --git a/overlay/etc/services.d/.s6-svscan/finish b/overlay/etc/services.d/.s6-svscan/finish old mode 100644 new mode 100755 index 1dadeea..039e4d0 --- a/overlay/etc/services.d/.s6-svscan/finish +++ b/overlay/etc/services.d/.s6-svscan/finish @@ -1,2 +1,2 @@ #!/bin/sh -/bin/true +exit 0 diff --git a/overlay/usr/local/bin/entrypoint.sh b/overlay/usr/local/bin/entrypoint.sh index 5f3ecd1..bce7dbc 100755 --- a/overlay/usr/local/bin/entrypoint.sh +++ b/overlay/usr/local/bin/entrypoint.sh @@ -2,6 +2,11 @@ /usr/local/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl /usr/local/bin/gomplate -V -o /var/www/app/config.php -f /etc/templates/config.php.tmpl +# ensure lock folders exists +mkdir -p /var/www/app/lock/images +mkdir -p /var/www/app/lock/upload +mkdir -p /var/www/app/lockexport + chown -R nginx:nginx /var/www/app/lock chown -R nginx:nginx /var/www/app/cache chown -R nginx:nginx /var/www/app/feed-icons diff --git a/overlay/usr/local/bin/healthcheck.sh b/overlay/usr/local/bin/healthcheck.sh index 13b224f..db3c94d 100755 --- a/overlay/usr/local/bin/healthcheck.sh +++ b/overlay/usr/local/bin/healthcheck.sh @@ -9,6 +9,7 @@ wget --quiet --tries=1 --spider ${URL} CONTENT=$(wget --quiet -O - ${URL}) case "$CONTENT" in *Exception*) exit 1 ;; + *misconfiguration*) exit 1 ;; esac exit 0