From c9445b4e783ec4d9539b9c0556b2eda62c3f3114 Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 24 May 2026 14:52:41 +0100 Subject: [PATCH] fix(rootless): task service DOCKER_HOST points at the install user's socket The rootless task-processor service env used id -u $sudo_user_name (the manager, e.g. 1001) for DOCKER_HOST/XDG_RUNTIME_DIR, but the rootless daemon runs as the docker install user, so its socket lives at /run/user//docker.sock (e.g. 1002). The manager-uid path doesn't exist. Use id -u $CFG_DOCKER_INSTALL_USER so the env matches the actual rootless socket (same values dockerCommandRunInstallUser uses). Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- scripts/webui/webui_install_systemd.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/webui/webui_install_systemd.sh b/scripts/webui/webui_install_systemd.sh index d049a78..eebe079 100755 --- a/scripts/webui/webui_install_systemd.sh +++ b/scripts/webui/webui_install_systemd.sh @@ -24,12 +24,17 @@ installLibrePortalWebUITaskService() # back to /var/run/docker.sock (which rootless does not create) and any # `docker …` call inside the task would fail. Rootful gets no extras — # the default /var/run path is already correct. + # + # The rootless daemon runs as the DOCKER INSTALL USER, so its socket lives in + # that user's runtime dir — not the manager's. Use the docker install user's + # uid here (matches dockerCommandRunInstallUser); pointing at the manager's + # uid was wrong — that socket doesn't exist. local service_env_block="" if [[ "$CFG_DOCKER_INSTALL_TYPE" == "rootless" ]]; then - local libreportal_uid - libreportal_uid="$(id -u "$sudo_user_name")" - service_env_block="Environment=DOCKER_HOST=unix:///run/user/${libreportal_uid}/docker.sock -Environment=XDG_RUNTIME_DIR=/run/user/${libreportal_uid}" + local docker_install_uid + docker_install_uid="$(id -u "$CFG_DOCKER_INSTALL_USER")" + service_env_block="Environment=DOCKER_HOST=unix:///run/user/${docker_install_uid}/docker.sock +Environment=XDG_RUNTIME_DIR=/run/user/${docker_install_uid}" fi # Create systemd service file