From dac8efba603774ae0cc266429d35145b8bac3657 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 18 Aug 2026 21:36:49 +0200 Subject: [PATCH] fix(scrutiny_original): keep real /init as PID 1 so s6 supervision starts (#2991) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(scrutiny_original): keep real /init as PID 1 so s6 supervision starts collector-once's s6-svwait -u /run/service/scrutiny fails because ha_entrypoint.sh (not the image's own /init) was PID 1 and never runs real s6 supervision, so /run/service/* never gets created. Same root cause and fix as scrutiny/scrutiny_fa (#2878): keep /init as PID 1 and let ha_entrypoint.sh act only as the S6_STAGE2_HOOK. Verified against the actual analogj/scrutiny:latest-omnibus image (pulled via the GHCR registry API): its collector-once run script is byte-identical to the one that caused #2877, and it bundles the same s6-overlay-3.1.6.2. Closes #2989 * fix(scrutiny_original): symlink /command into /usr/bin at build time With /init as PID 1, ha_entrypoint.sh's own PID1 branch (which creates this same symlink at runtime, and rewrites service run-file shebangs) never runs. nginx/run and finish use #!/usr/bin/with-contenv bashio, which only resolves if /usr/bin/with-contenv exists — so without this, nginx (ingress) fails to start. scrutiny/Dockerfile and scrutiny_fa/Dockerfile already do this in their "Install apps" stage; this was missed when porting their PID-1 fix over. Caught by chatgpt-codex-connector's PR review. --- scrutiny_original/CHANGELOG.md | 3 +++ scrutiny_original/Dockerfile | 27 ++++++++++++++++++++++----- scrutiny_original/config.yaml | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/scrutiny_original/CHANGELOG.md b/scrutiny_original/CHANGELOG.md index 192dae0a6b..10c77de694 100644 --- a/scrutiny_original/CHANGELOG.md +++ b/scrutiny_original/CHANGELOG.md @@ -1,4 +1,7 @@ +## v0.9.3.1 (2026-08-18) +- Fix startup crash: `collector-once` failed with `s6-svwait: fatal: unable to subscribe to events for /run/service/scrutiny` because the add-on entrypoint never started real s6 supervision. Keep the upstream image's own `/init` as PID 1 (same fix already shipped for `scrutiny`/`scrutiny_fa` in #2878). Closes #2989. + ## v0.9.3 (2026-08-13) - Update to latest version from analogj/scrutiny (changelog : https://github.com/analogj/scrutiny/releases) diff --git a/scrutiny_original/Dockerfile b/scrutiny_original/Dockerfile index 225e41bd91..53e6294f29 100644 --- a/scrutiny_original/Dockerfile +++ b/scrutiny_original/Dockerfile @@ -33,7 +33,8 @@ ENV S6_CMD_WAIT_FOR_SERVICES=1 \ # Add rootfs COPY rootfs/ / -RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \; +RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \; && \ + if [ -d /command ]; then ln -sf /command/* /usr/bin/; fi # Uses /bin for compatibility purposes # hadolint ignore=DL4005 @@ -61,17 +62,33 @@ RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps. # 4 Entrypoint # ################ -# Add entrypoint +# Keep the repository initialization hook, but return after it has prepared the +# cont-init scripts. Upstream s6 remains responsible for supervising services. ENV S6_STAGE2_HOOK=/ha_entrypoint.sh COPY ha_entrypoint.sh /ha_entrypoint.sh -RUN chmod 777 /ha_entrypoint.sh +RUN chmod 0755 /ha_entrypoint.sh && \ + awk '!inserted && $0 == "if $PID1; then" { \ + print "if ! $PID1; then"; \ + print " echo \"Initialization hook complete\""; \ + print " exit 0"; \ + print "fi"; \ + inserted=1 \ + } { print }' /ha_entrypoint.sh > /ha_entrypoint.sh.tmp && \ + mv /ha_entrypoint.sh.tmp /ha_entrypoint.sh && \ + chmod 0755 /ha_entrypoint.sh # Install bashio COPY bashio-standalone.sh /usr/local/lib/bashio-standalone.sh RUN chmod 0755 /usr/local/lib/bashio-standalone.sh -ENTRYPOINT [ "/usr/bin/env" ] -CMD [ "/ha_entrypoint.sh" ] +RUN test -x /init && \ + test -x /ha_entrypoint.sh && \ + bash -n /ha_entrypoint.sh && \ + grep -q 'Initialization hook complete' /ha_entrypoint.sh + +# Scrutiny's image already includes s6-overlay and defines all services under +# /etc/services.d. Keep /init as PID 1 so service readiness and s6-svc calls work. +ENTRYPOINT [ "/init" ] ############ # 5 Labels # diff --git a/scrutiny_original/config.yaml b/scrutiny_original/config.yaml index 0276681059..85e1145b4f 100644 --- a/scrutiny_original/config.yaml +++ b/scrutiny_original/config.yaml @@ -113,4 +113,4 @@ schema: slug: scrutiny_original udev: true url: https://github.com/analogj/scrutiny -version: "v0.9.3" +version: "v0.9.3.1"