From de632e482892faa6f56f576613692b76bed1468e Mon Sep 17 00:00:00 2001 From: wiedehopf Date: Tue, 6 Aug 2024 22:42:37 +0200 Subject: [PATCH] stop unneeded s6 services instead of exec sleep inf (#126) Dockerfile: fix case --- Dockerfile | 2 +- rootfs/etc/s6-overlay/scripts/adsbx-stats | 6 +++--- rootfs/etc/s6-overlay/scripts/mlat-client | 4 ++-- rootfs/etc/s6-overlay/scripts/mlathub | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76726cd..5619dd4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient as buildimage +FROM ghcr.io/sdr-enthusiasts/docker-baseimage:mlatclient AS buildimage SHELL ["/bin/bash", "-x", "-o", "pipefail", "-c"] RUN \ diff --git a/rootfs/etc/s6-overlay/scripts/adsbx-stats b/rootfs/etc/s6-overlay/scripts/adsbx-stats index be21583..2966d21 100755 --- a/rootfs/etc/s6-overlay/scripts/adsbx-stats +++ b/rootfs/etc/s6-overlay/scripts/adsbx-stats @@ -23,13 +23,13 @@ source /scripts/interpret_ultrafeeder_config # Check if ADSBExchange is configured if ! grep -i adsbexchange.com <<< "$ULTRAFEEDER_CONFIG" >/dev/null 2>&1; then "${s6wrap[@]}" echo "AdsbExchange not configured - no stats package needed" - exec sleep infinity + stop_service fi # Check if ADSBExchange stats are disabled if chk_disabled "$ADSBX_STATS" ; then "${s6wrap[@]}" echo "AdsbExchange stats disabled" - exec sleep infinity + stop_service fi # prep work: @@ -42,7 +42,7 @@ fi if [[ ! -f /usr/local/bin/json-status ]]; then if ! curl -sSL -o /usr/local/bin/json-status https://raw.githubusercontent.com/sdr-enthusiasts/docker-adsb-ultrafeeder/main/downloads/adsbexchange-json-status; then "${s6wrap[@]}" echo "ERROR: AdsbExchange configured, but cannot download stats package! AdsbExchange will be fed but stats will not be available" - exec sleep infinity + stop_service fi chmod 755 /usr/local/bin/json-status fi diff --git a/rootfs/etc/s6-overlay/scripts/mlat-client b/rootfs/etc/s6-overlay/scripts/mlat-client index 326314e..515da71 100755 --- a/rootfs/etc/s6-overlay/scripts/mlat-client +++ b/rootfs/etc/s6-overlay/scripts/mlat-client @@ -42,13 +42,13 @@ declare -A pid_array if [[ -z "${MLAT_CONFIG}" ]] then "${s6wrap[@]}" --args echo "Warning: MLAT_CONFIG not defined - MLAT will be disabled." - exec sleep infinity + stop_service fi if [[ -z "${MLAT_USER}" ]] && [[ -z "${UUID}" ]] then "${s6wrap[@]}" --args echo "ERROR: either UUID or MLAT_USER must be defined - MLAT will be disabled." - exec sleep infinity + stop_service fi function check_gpsd() { diff --git a/rootfs/etc/s6-overlay/scripts/mlathub b/rootfs/etc/s6-overlay/scripts/mlathub index 37d28e1..4edc250 100755 --- a/rootfs/etc/s6-overlay/scripts/mlathub +++ b/rootfs/etc/s6-overlay/scripts/mlathub @@ -31,12 +31,12 @@ fi if [[ -z "${MLAT_CONFIG}" ]] && [[ -z "$MLATHUB_NET_CONNECTOR" ]] && [[ ${#MLATHUB_CONF_ARR[@]} == 0 ]] && ! chk_enabled "${MLATHUB_ENABLE}"; then "${s6wrap[@]}" --args echo "No MLAT servers have been defined in MLAT_CONFIG and no external sources have been defined in MLATHUB_NET_CONNECTOR - no need to start MLATHUB" - exec sleep infinity + stop_service fi if chk_enabled "${MLATHUB_DISABLE}"; then "${s6wrap[@]}" --args echo "MLATHUB is disabled." - exec sleep infinity + stop_service fi # Build the readsb command line based on options