From c8fd824d258d78cdc220e2dd9f787020e0e3779c Mon Sep 17 00:00:00 2001 From: xuwei-fit2cloud Date: Mon, 11 Mar 2024 17:12:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20installer=20?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=AE=89=E8=A3=85=E5=8F=8A=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- installer/install.sh | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/installer/install.sh b/installer/install.sh index 6269da1125..27c9ad8815 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -18,8 +18,17 @@ compose_files="-f docker-compose.yml" INSTALL_TYPE='install' if [ -f /usr/bin/dectl ]; then # 获取已安装的 DataEase 的运行目录 + cd ${CURRENT_DIR} DE_BASE=$(grep "^DE_BASE=" /usr/bin/dectl | cut -d'=' -f2) - dectl stop + sed -i -e "s#DE_BASE=.*#DE_BASE=${DE_BASE}#g" dectl + \cp dectl /usr/local/bin && chmod +x /usr/local/bin/dectl + + if [[ ! -f /etc/systemd/system/dataease.service ]];then + systemctl stop dataease + else + dectl stop + fi + INSTALL_TYPE='upgrade' v2_version=$(dectl version | head -n 2 | grep "v2.") @@ -203,20 +212,23 @@ else cd - fi -if which chkconfig >/dev/null 2>&1;then - chkconfig dataease >/dev/null - if [ $? -eq 0 ]; then - chkconfig --del dataease - fi -fi if [[ -f /etc/init.d/dataease ]];then + if which chkconfig >/dev/null 2>&1;then + chkconfig dataease >/dev/null + if [ $? -eq 0 ]; then + chkconfig --del dataease + fi + fi rm -f /etc/init.d/dataease fi -log "配置 dataease Service" -cp ${DE_RUN_BASE}/bin/dataease/dataease.service /etc/systemd/system/ -chmod 644 /etc/systemd/system/dataease.service -log "配置开机自启动" -systemctl enable dataease >/dev/null 2>&1; systemctl daemon-reload | tee -a ${CURRENT_DIR}/install.log + +if [[ ! -f /etc/systemd/system/dataease.service ]];then + log "配置 dataease Service" + cp ${DE_RUN_BASE}/bin/dataease/dataease.service /etc/systemd/system/ + chmod 644 /etc/systemd/system/dataease.service + log "配置开机自启动" + systemctl enable dataease >/dev/null 2>&1; systemctl daemon-reload | tee -a ${CURRENT_DIR}/install.log +fi if [[ $(grep "vm.max_map_count" /etc/sysctl.conf | wc -l) -eq 0 ]];then sysctl -w vm.max_map_count=2000000