From 464c7362d8a3e7e26754a5ae666d899634b52102 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 13:06:45 +0000 Subject: [PATCH] fix(maintainerr): fix broken init script execution causing ingress 404 The entrypoint used `bashio "$script"` to run init scripts, but bashio CLI is a function dispatcher (bashio::"${@}"), not a script interpreter. This meant 32-nginx_ingress.sh never executed, leaving nginx config with unsubstituted %%port%%/%%interface%%/%%ingress_entry%% placeholders, so nginx failed to start and ingress returned 404. Fix: source the bashio library first, then run each init script via `source` in a subshell so bashio:: functions are inherited. Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/d5bff0a8-62ba-4564-a4fc-74c87d8b0d55 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- maintainerr/rootfs/ha_entrypoint.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/maintainerr/rootfs/ha_entrypoint.sh b/maintainerr/rootfs/ha_entrypoint.sh index 7f3601cf7..463da1894 100755 --- a/maintainerr/rootfs/ha_entrypoint.sh +++ b/maintainerr/rootfs/ha_entrypoint.sh @@ -7,13 +7,23 @@ set -e # Runs cont-init.d scripts then drops privileges and starts the app. ############################################################################### +# ─── Source bashio library so init scripts can use bashio:: functions ───────── +for _f in /usr/lib/bashio/bashio /usr/lib/bashio/bashio.sh; do + if [ -f "$_f" ]; then + # shellcheck disable=SC1090 + source "$_f" + break + fi +done + # ─── Run cont-init.d scripts ───────────────────────────────────────────────── if [ -d /etc/cont-init.d ]; then for script in /etc/cont-init.d/*.sh; do [ -f "$script" ] || continue - sed -i '1s|.*|#!/usr/bin/env bashio|' "$script" echo "[Maintainerr] Running init script: $script" - bashio "$script" + # Run in subshell to isolate side effects; bashio functions are inherited + # shellcheck disable=SC1090 + ( source "$script" ) done fi