From 0cf6419c2e609e39f6291296aef3c26210bbd7a4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 20 Jul 2025 16:25:01 +0200 Subject: [PATCH] Add services.d --- .templates/ha_entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index 4c115bc95..4d852d93d 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -53,6 +53,18 @@ for SCRIPTS in /etc/cont-init.d/*; do rm "$SCRIPTS" done +# Start services.d +for service_dir in /etc/services.d/*; do + runfile="${service_dir}/run" + if [[ -f "$runfile" ]]; then + echo "Patching and starting: $runfile" + # Replace s6-setuidgid with su-based equivalent + sed -i -E 's|^s6-setuidgid[[:space:]]+([a-zA-Z0-9._-]+)[[:space:]]+(.*)$|su -s /bin/bash \1 -c "\2"|g' "$runfile" + chmod +x "$runfile" + ( exec "$runfile" ) & true + fi +done + ###################### # Starting container # ######################