From 7ac6847f1c7939bd3d2691e699cada0bba2be117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=AD=90=E6=9D=8E=C2=B7De?= Date: Sat, 24 Jul 2021 14:56:26 +0800 Subject: [PATCH] Update start.sh --- report-core/src/main/assembly/bin/start.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/report-core/src/main/assembly/bin/start.sh b/report-core/src/main/assembly/bin/start.sh index 8b7a8c70..24b909ac 100755 --- a/report-core/src/main/assembly/bin/start.sh +++ b/report-core/src/main/assembly/bin/start.sh @@ -1,4 +1,8 @@ #!/bin/bash + +#判断java是否存在 +command -v java >/dev/null 2>&1 || { echo >&2 "require java but it's not installed. Aborting."; sleep 5;exit 1; } + cd `dirname $0` BIN_DIR=`pwd` #安装目录 cd .. @@ -7,13 +11,7 @@ LIB_DIR=$DEPLOY_DIR/lib #jar目录 CONF_DIR=$DEPLOY_DIR/conf #conf目录 LOGS_DIR=$DEPLOY_DIR/logs #log目录 -LIB_JARS=`ls $LIB_DIR|grep -v aj-report*.jar|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"` - -JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k " - -echo "$DEPLOY_DIR" -echo "$LIB_JARS" - +LIB_JARS=`ls $LIB_DIR|grep -v aj-report|awk '{print "'$LIB_DIR'/"$0}'|tr "\n" ":"` PIDS=`ps -f | grep java | grep "aj-report" |awk '{print $2}'` if [ -n "$PIDS" ]; then @@ -22,7 +20,7 @@ if [ -n "$PIDS" ]; then exit 1 fi - +JAVA_OPTS=" -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k " nohup java $JAVA_OPTS -Xbootclasspath/a:$LIB_JARS -jar -Dspring.config.location=$CONF_DIR/bootstrap.yml $LIB_DIR/aj-report-*.jar >/dev/null 2>&1 & echo "The AJ-Report started!" \ No newline at end of file