From b5862b4ee565bc19a9a980f1aa5603b34487ad5c Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:44:15 +0200 Subject: [PATCH] OneDev: use the onedev.server unit of 16.9 (#17949) 16.9.0 replaced the Tanuki wrapper; a fresh server.sh install now creates onedev.server.service, so the install failed on 'Unit onedev.service not found' (#17943). Upgraded installs keep their onedev.service, so update uses whichever unit exists. --- ct/onedev.sh | 9 ++++++--- install/onedev-install.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ct/onedev.sh b/ct/onedev.sh index 6d6c9096b..bbd7c76e3 100644 --- a/ct/onedev.sh +++ b/ct/onedev.sh @@ -25,7 +25,10 @@ function update_script() { check_container_storage check_container_resources - if [[ ! -f /etc/systemd/system/onedev.service ]]; then + # Installs from before 16.9.0 keep their onedev.service; newer ones get onedev.server.service + SERVICE="onedev.server" + [[ -f /etc/systemd/system/onedev.service ]] && SERVICE="onedev" + if [[ ! -f "/etc/systemd/system/${SERVICE}.service" ]]; then msg_error "No ${APP} Installation Found!" exit fi @@ -34,7 +37,7 @@ function update_script() { JAVA_VERSION="21" setup_java msg_info "Stopping Service" - systemctl stop onedev + systemctl stop "$SERVICE" msg_ok "Stopped Service" msg_info "Updating OneDev" @@ -48,7 +51,7 @@ function update_script() { msg_ok "Updated OneDev" msg_info "Starting Service" - systemctl start onedev + systemctl start "$SERVICE" msg_ok "Started Service" msg_ok "Updated successfully!" exit diff --git a/install/onedev-install.sh b/install/onedev-install.sh index 7b34bfa3c..5bab28bff 100644 --- a/install/onedev-install.sh +++ b/install/onedev-install.sh @@ -28,7 +28,7 @@ curl -fsSL "https://code.onedev.io/onedev/server/~sites/public/onedev-latest.tar tar -xzf onedev-latest.tar.gz mv /opt/onedev-latest /opt/onedev $STD /opt/onedev/bin/server.sh install -systemctl start onedev +systemctl start onedev.server rm -rf /opt/onedev-latest.tar.gz echo "${RELEASE}" >~/.onedev msg_ok "Installed OneDev"