From b4ef62b157ccf7823b1c65545cca3ecbdabd0e17 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Tue, 18 Oct 2022 20:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=907.2.5=E3=80=91=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=90=AF=E5=8A=A8Guns=E7=9A=84=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/start-guns.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 bash/start-guns.sh diff --git a/bash/start-guns.sh b/bash/start-guns.sh new file mode 100644 index 00000000..d3b8a02d --- /dev/null +++ b/bash/start-guns.sh @@ -0,0 +1,14 @@ +#!/bin/sh +echo " =====关闭Guns应用======" +PROCESS=`ps -ef | grep java | grep -v grep | grep guns.jar | awk '{print $2}'` +for i in $PROCESS +do + echo "Kill the $1 process [ $i ]" + kill -9 $i +done +echo " =====启动Java应用======" +nohup java -Xms1024M -Xmx1024M -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512M -jar guns.jar --spring.profiles.active=local > guns.out & +echo $! > guns-pid.txt +cat guns-pid.txt +rm guns-pid.txt +tail -f guns.out \ No newline at end of file