Skip to content

Commit

Permalink
restructure logging, bugfix and fix datalogger service
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram van Dartel committed Apr 18, 2024
1 parent 7c8a90e commit 590a4a5
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 22 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions rootfs/etc/s6-overlay/s6-rc.d/init-docker-entrypoint/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions rootfs/etc/s6-overlay/s6-rc.d/sig-handler/run

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/etc/s6-overlay/s6-rc.d/sig-handler/type

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/etc/s6-overlay/s6-rc.d/sig-handler/up

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
svc-dsmr-datalogger
svc-dsmr-webinterface
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/s6-rc.d/svc-dsmr-webinterface/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
longrun
longrun

0 comments on commit 590a4a5

Please sign in to comment.