diff --git a/qbittorrent/CHANGELOG.md b/qbittorrent/CHANGELOG.md index 333fb837c6..ef1dc986d2 100644 --- a/qbittorrent/CHANGELOG.md +++ b/qbittorrent/CHANGELOG.md @@ -1,4 +1,8 @@ +## 5.2.0-3 (2026-05-10) +- Fix qBittorrent restart loop: remove s6-notifyoncheck (notification-fd 3 EBADF when not running under s6-rc), discover binary path dynamically across LSIO image layouts, remove `/dev/stdout` redirect that fails on some ARM runtimes, align with upstream LSIO run script (WebUI address from config, LSIO_NON_ROOT_USER) +- Fix Dockerfile: add missing `-i` flag to `sed '11,13d'` so default config lines are actually removed at build time + ## 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 diff --git a/qbittorrent/Dockerfile b/qbittorrent/Dockerfile index bc70c27c07..ef7301c647 100644 --- a/qbittorrent/Dockerfile +++ b/qbittorrent/Dockerfile @@ -46,8 +46,8 @@ RUN \ # Set download folder to /share sed -i 's|/downloads/|/share/qBittorrent/|g' /defaults/qBittorrent.conf \ \ - # Remove fixed folders, allows connection to webUI - && sed '11,13d' /defaults/qBittorrent.conf \ + # Remove fixed folders (SavePath/ScanDirsV2/TempPath), handled by init script + && sed -i '11,13d' /defaults/qBittorrent.conf \ && echo 'WebUI\HostHeaderValidation=false' >> /defaults/qBittorrent.conf \ && echo 'WebUI\LocalHostAuth=false' >> /defaults/qBittorrent.conf \ \ diff --git a/qbittorrent/config.yaml b/qbittorrent/config.yaml index 9b987cc09b..78eca23a9f 100644 --- a/qbittorrent/config.yaml +++ b/qbittorrent/config.yaml @@ -143,4 +143,4 @@ schema: slug: qbittorrent udev: true url: https://github.com/alexbelgium/hassio-addons -version: "5.2.0-2" +version: "5.2.0-3" diff --git a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run index 23110a2c61..5d51f2e215 100644 --- a/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run +++ b/qbittorrent/rootfs/etc/s6-overlay/s6-rc.d/svc-qbittorrent/run @@ -4,6 +4,12 @@ WEBUI_PORT=${WEBUI_PORT:-8080} export PATH="/usr/local/sbin:/usr/local/bin:${PATH}" +# Read WebUI bind address from config (mirrors upstream LSIO approach) +WEBUI_ADDRESS=$(grep -Po "^WebUI\\\\Address=\K(.*)" /config/qBittorrent/qBittorrent.conf 2>/dev/null || echo "") +if [[ -z ${WEBUI_ADDRESS} ]] || [[ ${WEBUI_ADDRESS} == "*" ]]; then + WEBUI_ADDRESS="localhost" +fi + # --- Configuration & Pre-checks --- if bashio::config.true 'silent'; then @@ -36,10 +42,18 @@ fi # --- Launch qBittorrent --- -# Determine log output based on silent mode -QB_OUTPUT="/dev/stdout" -if bashio::config.true 'silent'; then - QB_OUTPUT="/dev/null" +# 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 # Find qbittorrent-nox binary across different LSIO image layouts @@ -58,4 +72,15 @@ fi bashio::log.info "Starting qBittorrent..." -exec s6-setuidgid abc "${QB_BIN}" --webui-port="${WEBUI_PORT}" > "${QB_OUTPUT}" +# Suppress output in silent mode by redirecting the current shell's stdout/stderr +# before exec replaces the process (avoids opening /dev/stdout which may fail on +# some ARM platforms / container runtimes). +if bashio::config.true 'silent'; then + exec >/dev/null 2>&1 +fi + +if [[ -z ${LSIO_NON_ROOT_USER} ]]; then + exec s6-setuidgid abc "${QB_BIN}" --webui-port="${WEBUI_PORT}" +else + exec "${QB_BIN}" --webui-port="${WEBUI_PORT}" +fi