diff --git a/Dockerfile b/Dockerfile index d25a34b..37b927b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,10 +33,8 @@ ENV PS1="$(whoami)@dsmr_reader_docker:$(pwd)\\$ " \ ENV QEMU_ARCH=${QEMU_ARCH:-x86_64} \ DSMR_VERSION=${DSMR_VERSION} \ DOCKER_TARGET_RELEASE=${DOCKER_TARGET_RELEASE} \ - PIP_NO_CACHE_DIR=1 - # S6_SERVICES_GRACETIME=30000 \ - # S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 - # S6_BEHAVIOUR_IF_STAGE2_FAILS=1 + PIP_NO_CACHE_DIR=1 \ + S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 ENV DJANGO_SECRET_KEY=dsmrreader \ DJANGO_DATABASE_ENGINE=django.db.backends.postgresql \ diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-docker-entrypoint/run b/rootfs/etc/s6-overlay/s6-rc.d/init-docker-entrypoint/run index adb7fcf..45242fd 100755 --- a/rootfs/etc/s6-overlay/s6-rc.d/init-docker-entrypoint/run +++ b/rootfs/etc/s6-overlay/s6-rc.d/init-docker-entrypoint/run @@ -187,11 +187,11 @@ function _check_db_availability() { fi if [[ -n "${DJANGO_DATABASE_ENGINE}" ]]; then _info "Verifying database connectivity to host: ${DJANGO_DATABASE_HOST} with port: ${DJANGO_DATABASE_PORT}..." - for i in {1..30}; do - if ! nc -z "${DJANGO_DATABASE_HOST}" "${DJANGO_DATABASE_PORT}"; then + for i in {1..10}; do + if ! nc -z "${DJANGO_DATABASE_HOST}" "${DJANGO_DATABASE_PORT}" > /dev/null 2>&1; then sleep 1 - printf "\\rTesting database connectivity: %s second(s) of 30 seconds..." "$i" - if [[ $i == 30 ]]; then + printf "\\rTesting database connectivity: %s second(s) of 10 seconds..." "$i" + if [[ $i == 10 ]]; then _error "Database connectivity couldn't be verified! Please verify your settings. Exiting..." exit 1 fi diff --git a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/run b/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/run deleted file mode 100755 index 1e42a57..0000000 --- a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/run +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/execlineb -P -# /etc/s6-overlay/s6-rc.d/sig-handler/run -# shellcheck shell=bash - -# Trap SIGINT and gracefully shutdown -foreground { - s6-trap-init SIGINT -} -importas -u SIGINT SIGINT -s6-svscanctl -t /var/run/s6/services diff --git a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/type b/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/type deleted file mode 100755 index 1780f9f..0000000 --- a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/type +++ /dev/null @@ -1 +0,0 @@ -longrun \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/up b/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/up deleted file mode 100755 index 18cbcab..0000000 --- a/rootfs/etc/s6-overlay/s6-rc.d/sig-handler/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/sig-handler/run \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/dependencies b/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/dependencies index 13cf561..aa61ec9 100755 --- a/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/dependencies +++ b/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface-log/dependencies @@ -1 +1 @@ -svc-dsmr-datalogger \ No newline at end of file +svc-dsmr-webinterface \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/type b/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/type index 5883cff..1780f9f 100755 --- a/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/type +++ b/rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/type @@ -1 +1 @@ -longrun +longrun \ No newline at end of file