fix(scrutiny_fa_original): keep real /init as PID 1 so s6 supervision starts (#2992)

Same bug and root cause as scrutiny_original (#2991) and scrutiny/scrutiny_fa
(#2878): 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.

scrutiny_fa_original shares the exact same rootfs (byte-identical cont-init.d
and services.d/nginx scripts) as scrutiny_original and builds from the same
ghcr.io/analogj/scrutiny:latest-omnibus image, so the same fix applies:
keep /init as PID 1, patch ha_entrypoint.sh to hand off to real s6-rc
supervision, and symlink /command into /usr/bin at build time (nginx/run and
finish use #!/usr/bin/with-contenv bashio, which only resolves once that
symlink exists — a P1 finding from scrutiny_original's PR review that
applies here identically).

Keeps the existing bashio::require.unprotected guard in
/etc/cont-init.d/90-run.sh unchanged.
This commit is contained in:
Alexandre
2026-08-18 21:36:35 +02:00
committed by GitHub
parent 84dfd1b996
commit 87f69ce79b
3 changed files with 26 additions and 6 deletions

View File

@@ -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 as `scrutiny_original` (#2991) and `scrutiny`/`scrutiny_fa` (#2878).
## v0.9.3 (2026-08-13)
- Update to latest version from analogj/scrutiny (changelog : https://github.com/analogj/scrutiny/releases)

View File

@@ -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,19 +62,35 @@ 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
RUN test -x /init && \
test -x /ha_entrypoint.sh && \
bash -n /ha_entrypoint.sh && \
grep -q 'Initialization hook complete' /ha_entrypoint.sh
RUN sed -i "1a if ! bashio::require.unprotected; then bashio::addon.stop; fi" /etc/cont-init.d/90-run.sh
ENTRYPOINT [ "/usr/bin/env" ]
CMD [ "/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 #

View File

@@ -45,4 +45,4 @@ schema:
slug: scrutiny_fa_original
udev: true
url: https://github.com/analogj/scrutiny
version: "v0.9.3"
version: "v0.9.3.1"