From ba01175bc662d03f3c41249e9b175e708a91eb3a Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 19 Mar 2026 06:55:56 +0100 Subject: [PATCH] core: reorder hwaccel setup and adjust GPU group usermod (#13072) * fix(tdarr): use curl_with_retry and verify binaries before enabling service Tdarr_Updater downloads the actual server/node binaries from tdarr.io at runtime. If tdarr.io is blocked by local DNS (e.g. OPNsense OISD blocklists), the updater exits silently with code 0, leaving no binaries on disk. The subsequent systemctl enable then fails with 'Operation not permitted' (exit 1) because the ExecStart paths don't exist. Changes: - Replace bare curl with curl_with_retry for versions.json and Tdarr_Updater.zip downloads to gain retry logic, DNS pre-check and exponential backoff - Add msg_info before Tdarr_Updater run so users see this step in the log - Check that Tdarr_Server and Tdarr_Node binaries exist after the updater runs; fail immediately with a clear message pointing to tdarr.io connectivity instead of letting systemctl fail with a confusing 'Operation not permitted' Fixes: #13030 * Improve Tdarr installer error handling Refine post-update validation and failure behavior in tdarr-install.sh: remove a redundant status message, simplify the updater check to only require the Tdarr_Server binary, and replace the previous fatal path with msg_error plus an explicit exit 250. This makes failures (for example when tdarr.io is blocked by local DNS) clearer and avoids false negatives from the Tdarr_Node existence check. * Use curl_with_retry and handle updater failure Replace direct curl calls with curl_with_retry for fetching versions.json and downloading Tdarr_Updater.zip to improve network reliability. Add a post-update check that verifies /opt/tdarr/Tdarr_Server/Tdarr_Server exists; if missing, log an error suggesting possible DNS blocking and exit with code 250. Minor cleanup of updater artifacts remains unchanged. * Reorder hwaccel setup and adjust GPU group usermod Move setup_hwaccel invocations in emby, jellyfin, ollama, and plex installers to occur after package installation/configuration so GPU drivers/repos are present before enabling hardware acceleration. Update _setup_gpu_permissions to call usermod directly (remove $STD wrapper) when adding service users to render/video groups. Includes minor whitespace/ordering cleanups in the installer scripts. --- install/emby-install.sh | 4 ++-- install/jellyfin-install.sh | 3 ++- install/ollama-install.sh | 4 ++-- install/plex-install.sh | 4 ++-- misc/tools.func | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/install/emby-install.sh b/install/emby-install.sh index 84b879f3c..e7c29fbac 100644 --- a/install/emby-install.sh +++ b/install/emby-install.sh @@ -13,10 +13,10 @@ setting_up_container network_check update_os -setup_hwaccel "emby" - fetch_and_deploy_gh_release "emby" "MediaBrowser/Emby.Releases" "binary" +setup_hwaccel "emby" + motd_ssh customize cleanup_lxc diff --git a/install/jellyfin-install.sh b/install/jellyfin-install.sh index 36053270c..a25ac387f 100644 --- a/install/jellyfin-install.sh +++ b/install/jellyfin-install.sh @@ -14,7 +14,6 @@ network_check update_os msg_custom "ℹ️" "${GN}" "If NVIDIA GPU passthrough is detected, you'll be asked whether to install drivers in the container" -setup_hwaccel "jellyfin" msg_info "Installing Dependencies" ensure_dependencies libjemalloc2 @@ -37,6 +36,8 @@ ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/bin/ffmpeg ln -sf /usr/lib/jellyfin-ffmpeg/ffprobe /usr/bin/ffprobe msg_ok "Installed Jellyfin" +setup_hwaccel "jellyfin" + msg_info "Configuring Jellyfin" # Configure log rotation to prevent disk fill (keeps fail2ban compatibility) (PR: #1690 / Issue: #11224) cat </etc/logrotate.d/jellyfin diff --git a/install/ollama-install.sh b/install/ollama-install.sh index 2d050f60c..b3dfb3648 100644 --- a/install/ollama-install.sh +++ b/install/ollama-install.sh @@ -42,8 +42,6 @@ EOF $STD apt update msg_ok "Set up Intel® Repositories" -setup_hwaccel "ollama" - msg_info "Installing Intel® Level Zero" # Debian 13+ has newer Level Zero packages in system repos that conflict with Intel repo packages if is_debian && [[ "$(get_os_version_major)" -ge 13 ]]; then @@ -92,6 +90,8 @@ fi $STD usermod -aG ollama $(id -u -n) msg_ok "Created ollama User and adjusted Groups" +setup_hwaccel "ollama" + msg_info "Creating Service" cat </etc/systemd/system/ollama.service [Unit] diff --git a/install/plex-install.sh b/install/plex-install.sh index 757bac495..8ed8bac6d 100644 --- a/install/plex-install.sh +++ b/install/plex-install.sh @@ -13,8 +13,6 @@ setting_up_container network_check update_os -setup_hwaccel "plex" - msg_info "Setting Up Plex Media Server Repository" setup_deb822_repo \ "plexmediaserver" \ @@ -28,6 +26,8 @@ msg_info "Installing Plex Media Server" $STD apt install -y plexmediaserver msg_ok "Installed Plex Media Server" +setup_hwaccel "plex" + motd_ssh customize cleanup_lxc diff --git a/misc/tools.func b/misc/tools.func index 799d03c96..af2d21435 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -5213,8 +5213,8 @@ _setup_gpu_permissions() { # Add service user to render and video groups for GPU hardware acceleration if [[ -n "$service_user" ]]; then - $STD usermod -aG render "$service_user" 2>/dev/null || true - $STD usermod -aG video "$service_user" 2>/dev/null || true + usermod -aG render "$service_user" 2>/dev/null || true + usermod -aG video "$service_user" 2>/dev/null || true fi }