1
0
Fork 0
mirror of https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git synced 2024-11-25 15:20:10 +00:00

delay start of MLAT Hub until all MLAT clients are up

This commit is contained in:
kx1t 2023-04-09 10:41:07 -04:00
parent 489569d29a
commit 221359c980
4 changed files with 55 additions and 2 deletions

View file

@ -0,0 +1,25 @@
#!/usr/bin/with-contenv bash
#shellcheck shell=bash disable=SC2015,SC1091
source /scripts/common
# Remove MLATHub Up
#---------------------------------------------------------------------------------------------
# Copyright (C) 2023, Ramon F. Kolb (kx1t)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#---------------------------------------------------------------------------------------------
rm -f /run/mlathub_up
exit 0

View file

@ -0,0 +1,25 @@
#!/usr/bin/with-contenv bash
#shellcheck shell=bash disable=SC2015,SC1091
source /scripts/common
# MLATHub Prep
#---------------------------------------------------------------------------------------------
# Copyright (C) 2023, Ramon F. Kolb (kx1t)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.
#---------------------------------------------------------------------------------------------
rm -f /run/mlathub_up
exit 0

View file

@ -131,6 +131,9 @@ sleep 10 # sleep a bit so everything is well established - starting readsb m
sleep 5 sleep 5
done done
# All MLAT Clients are up, so set the flag:
touch /run/mlathub_up
# Now iterate over all MLAT-client instances and check if they are still running: # Now iterate over all MLAT-client instances and check if they are still running:
while true while true
do do

View file

@ -99,10 +99,10 @@ fi
# Handle "--net-heartbeat=<rate>" # Handle "--net-heartbeat=<rate>"
MLATHUB_CMD+=("--net-heartbeat=${READSB_NET_HEARTBEAT:-30}") MLATHUB_CMD+=("--net-heartbeat=${READSB_NET_HEARTBEAT:-30}")
if ! pgrep readsb >/dev/null || ! pgrep 'mlat-client' >/dev/null if [[ ! -f /run/mlathub_up ]]
then then
echo "[$(date)][mlathub] Delaying MLAT hub start until container is established..." echo "[$(date)][mlathub] Delaying MLAT hub start until container is established..."
while ! pgrep readsb >/dev/null || ! pgrep 'mlat-client' >/dev/null while [[ ! -f /run/mlathub_up ]]
do do
sleep 2 sleep 2
done done