Fix aarch64 startup loop: use /proc/1/fd/1 instead of /dev/stdout

/dev/stdout resolves via /proc/self/fd/1 and can be inaccessible in some
ARM container runtimes, causing the exec redirect to fail and s6 to restart
the service in a loop. /proc/1/fd/1 is the path LSIO images already use
for direct container stdout (see nginx silent-mode handling) and is reliable
across architectures.

https://claude.ai/code/session_01F16ThtZyfXj6ZKFPkrSAAq
This commit is contained in:
Claude
2026-05-11 05:17:32 +00:00
parent e5048aa378
commit 862097d6bd

View File

@@ -37,21 +37,13 @@ fi
# --- Launch qBittorrent ---
# Determine log output based on silent mode
QB_OUTPUT="/dev/stdout"
QB_OUTPUT="/proc/1/fd/1"
if bashio::config.true 'silent'; then
QB_OUTPUT="/dev/null"
fi
bashio::log.info "Starting qBittorrent..."
# s6-notifyoncheck writes to fd 3 when its readiness check passes. s6-rc only
# opens fd 3 when the service directory contains a notification-fd file. Without
# it (LSIO arm64 images), s6-notifyoncheck exits with EBADF and s6 restarts the
# service in a loop. Fall back to running qbittorrent-nox directly in that case.
if [ -f /etc/s6-overlay/s6-rc.d/svc-qbittorrent/notification-fd ]; then
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
else
exec s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"
fi
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost ${WEBUI_PORT}" \
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"