From 0a8426d0c0167559012ef901a4d2de1129f52b03 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Mon, 14 Sep 2026 16:03:47 +0200 Subject: [PATCH] navidrome: restore data folder ownership on install and update Upstream's deb postinstall runs chown navidrome:navidrome on /var/lib/navidrome/cache without -R, and only behind an .installed flag, so it never runs again on an upgrade. Every navidrome command the packaging invokes as root creates cache content owned by root, which the service then cannot write as the navidrome user - artwork that was already cached keeps working while newly resolved album and playlist covers fail. Reassert ownership of the data folder after deploying the release. The music folder is left alone, it is commonly a bind mount. --- ct/navidrome.sh | 9 +++++++++ install/navidrome-install.sh | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/ct/navidrome.sh b/ct/navidrome.sh index 9665559c0..94d631f2e 100644 --- a/ct/navidrome.sh +++ b/ct/navidrome.sh @@ -38,6 +38,15 @@ function update_script() { fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary" + # The upstream postinstall only chowns the cache directory itself, and only + # on the very first install, so root-owned subdirectories survive upgrades + # and the service can no longer write its artwork there. + if id -u navidrome >/dev/null 2>&1; then + msg_info "Fixing Data Folder Ownership" + chown -R navidrome:navidrome /var/lib/navidrome + msg_ok "Fixed Data Folder Ownership" + fi + msg_info "Starting Services" systemctl start navidrome msg_ok "Started Services" diff --git a/install/navidrome-install.sh b/install/navidrome-install.sh index 8547e71ad..4da35c71c 100644 --- a/install/navidrome-install.sh +++ b/install/navidrome-install.sh @@ -19,6 +19,10 @@ msg_ok "Installed Dependencies" fetch_and_deploy_gh_release "navidrome" "navidrome/navidrome" "binary" +if id -u navidrome >/dev/null 2>&1; then + chown -R navidrome:navidrome /var/lib/navidrome +fi + msg_info "Starting Navidrome" systemctl enable -q --now navidrome msg_ok "Started Navidrome"