Fix qBittorrent restart loop: dynamic binary discovery and remove s6-notifyoncheck

s6-notifyoncheck exits with EBADF when notification-fd 3 isn't opened by
s6-rc (can happen depending on LSIO image layer order), killing the supervised
qBittorrent process and causing the 2-second restart loop. Dropping it lets
s6 supervise qBittorrent directly without the fragile fd notification path.

Also probe /app, /usr/bin, and /usr/local/bin for the binary so the addon
works across LSIO image builds that place qbittorrent-nox in different spots.

https://claude.ai/code/session_015eiGSjWjSVtKbBFhBHUeDt
This commit is contained in:
Claude
2026-05-10 05:03:48 +00:00
parent db21860d29
commit f241470906
3 changed files with 19 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
## 5.2.0-2 (2026-05-10)
- Fix qBittorrent restart loop: remove s6-notifyoncheck (avoids notification-fd EBADF crash) and discover binary path dynamically across LSIO image layouts
## 5.2.0-1 (2026-05-10)
- Fix qbittorrent-nox path (/usr/bin → /app) after LSIO image update

View File

@@ -143,4 +143,4 @@ schema:
slug: qbittorrent
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "5.2.0-1"
version: "5.2.0-2"

View File

@@ -42,8 +42,20 @@ if bashio::config.true 'silent'; then
QB_OUTPUT="/dev/null"
fi
# Find qbittorrent-nox binary across different LSIO image layouts
QB_BIN=""
for candidate in /app/qbittorrent-nox /usr/bin/qbittorrent-nox /usr/local/bin/qbittorrent-nox; do
if [[ -x "${candidate}" ]]; then
QB_BIN="${candidate}"
break
fi
done
if [[ -z "${QB_BIN}" ]]; then
bashio::log.fatal "qbittorrent-nox binary not found"
exit 1
fi
bashio::log.info "Starting qBittorrent..."
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}"
exec s6-setuidgid abc "${QB_BIN}" --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}"