From 2baee840e0ed403b5f1a8818de070888a279c557 Mon Sep 17 00:00:00 2001 From: bcalinat Date: Mon, 19 Jan 2026 00:04:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=AE=89=E8=A3=85)=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dwsl=E5=AE=89=E8=A3=85=E6=97=B6=E4=BD=BF=E7=94=A8docker?= =?UTF-8?q?=20desktop=E5=87=BA=E7=8E=B0docker.service=20not=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/installer/install.sh b/installer/install.sh index e318d51f01..493389981b 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -287,6 +287,13 @@ function load_de_images() { function set_de_service() { log_title "配置 DataEase 服务" + + # 判断是否为wsl + local is_wsl= false + if grep -qE "(Microsoft|microsoft|WLS)" /proc/version; then + is_wsl=true + fi + if [[ -f /etc/init.d/dataease ]];then if which chkconfig >/dev/null 2>&1;then chkconfig dataease >/dev/null @@ -300,6 +307,12 @@ function set_de_service() { if [[ ! -f /etc/systemd/system/dataease.service ]];then log_content "配置 dataease Service" cp ${DE_RUN_BASE}/bin/dataease/dataease.service /etc/systemd/system/ + #--- 如果是 WSL,则移除 service 文件中对 docker 的依赖 --- + if [ "$is_wsl" = true ]; then + log_content "检测到 WSL 环境,移除 dataease.service 中的 Docker 依赖配置" + sed -i '/docker.service/d' /etc/systemd/system/dataease.service + fi + #------------------------------------------------------ chmod 644 /etc/systemd/system/dataease.service log_content "配置开机自启动" systemctl enable dataease >/dev/null 2>&1; systemctl daemon-reload | tee -a ${CURRENT_DIR}/install.log