From 7590c8f95968f05ff6b25a6ca1ee80ba13ef3a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Wed, 21 Feb 2024 18:59:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8E=E4=BB=A3=E7=A0=81=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start-service/bootstrap-mdp-lcode.sh | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 start-service/bootstrap-mdp-lcode.sh diff --git a/start-service/bootstrap-mdp-lcode.sh b/start-service/bootstrap-mdp-lcode.sh new file mode 100644 index 0000000..bc56b62 --- /dev/null +++ b/start-service/bootstrap-mdp-lcode.sh @@ -0,0 +1,39 @@ +#!/bin/bash +###################################################################################### +### mall-lcode starter +### cyc 20190221 +### +### +##################################################################################### +cd .. + + +SERVICE_NAME=mdp-lcode +MVERSION= +SVERSION="2.0.0-RELEASE" +PROFILES=prod + +echo "将启动${SERVICE_NAME} 主版本${MVERSION} 子版本号${SVERSION} 配置文件${PROFILES}" + +if [ ! -d "./start-service/pid" ];then + mkdir ./start-service/pid +fi + +# 清理进程 +if [ -f "./start-service/pid/${SERVICE_NAME}.pid" ];then + PID=$(cat "./start-service/pid/${SERVICE_NAME}.pid") + kill -9 ${PID} + echo "成功停止服务${SERVICE_NAME}" +fi + + +# 执行启动程序 +echo "启动服务${SERVICE_NAME}" + +JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 +nohup ${JAVA_HOME}/bin/java -server -Xms512m -Xmx512m -Dfile.encoding=UTF-8 -jar ./lib/${SERVICE_NAME}-cloud-bootstrap-${SVERSION}.jar --spring.profiles.active=${PROFILES} >/dev/null 2>&1 & + +# 记录进程号 +echo $! > ./start-service/pid/${SERVICE_NAME}.pid + +echo "启动服务成功!!!!!!!! pid $!"