Basic dependency tracking - make sure pdnsmysql is up and running before starting pdns

This commit is contained in:
Bernhard "bero" Rosenkränzer (Boggins) 2025-02-18 01:31:25 +01:00
parent c79918c201
commit ce8bdc9b0a

View File

@ -358,10 +358,25 @@ start_service() {
SERVICE="$1"
COMMAND="$2"
RETRY="$3"
local DEPENDS=""
# Start /federated/apps/SERVICE with output to /dev/null
echo -ne "* Starting $SERVICE.."
if [ -e /federated/services/$SERVICE/service ]; then
. /federated/services/$SERVICE/services
if [ -n "$DEPENDS" ]; then
echo "Ensuring dependencies are up and running"
local dep
for dep in $DEPENDS; do
echo "* ... $dep"
if ! /federated/bin/check $dep; then
/federated/bin/fix $dep
fi
done
fi
fi
if [ $DEBUG ]; then
# Start /federated/apps/SERVICE with output to console for debug
docker compose -f /federated/apps/$SERVICE/docker-compose.yml -p $SERVICE up