Fix qbittorrent restart loop on aarch64: remove /dev/stdout redirect, align run script with LSIO upstream

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/3ce233ea-82a8-4032-92ee-5bf0a7616f74

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-10 14:57:37 +00:00
committed by GitHub
parent 0c156971d1
commit 61011dc352
4 changed files with 29 additions and 12 deletions

View File

@@ -1,4 +1,8 @@
## 5.2.0-2 (2026-05-10)
- Fix qbittorrent restart loop on aarch64/ARM64 devices (e.g. odroid-c2): remove `> /dev/stdout` redirect in service run script that could fail on certain container runtimes, align with upstream LSIO run script (read WebUI address from config, honour 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-1 (2026-05-10)
- Fix qbittorrent-nox path (/usr/bin → /app) after LSIO image update

View File

@@ -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 \
\

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

@@ -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,14 +42,21 @@ fi
# --- Launch qBittorrent ---
# Determine log output based on silent mode
QB_OUTPUT="/dev/stdout"
if bashio::config.true 'silent'; then
QB_OUTPUT="/dev/null"
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}"
# 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-notifyoncheck -d -n 300 -w 1000 -c "nc -z ${WEBUI_ADDRESS} ${WEBUI_PORT}" \
s6-setuidgid abc /app/qbittorrent-nox --webui-port="${WEBUI_PORT}"
else
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z ${WEBUI_ADDRESS} ${WEBUI_PORT}" \
/app/qbittorrent-nox --webui-port="${WEBUI_PORT}"
fi