Leechg

 

linux启动springboot项目 

 

start.sh

#!/bin/sh

rm -f tpid

nohup java -jar restDate-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev > /dev/null 2>&1 &

echo $! > tpid

echo Start Success!

 

stop.sh

#!/bin/sh
APP_NAME=restDate-0.0.1-SNAPSHOT

tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk \'{print $2}\'`
if [ ${tpid} ]; then
    echo \'Stop Process...\'
    kill -15 $tpid
fi
sleep 5
tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk \'{print $2}\'`
if [ ${tpid} ]; then
    echo \'Kill Process!\'
    kill -9 $tpid
else
    echo \'Stop Success!\'
fi

 

 

kill.sh

#!/bin/sh
APP_NAME=restDate-0.0.1-SNAPSHOT

tpid=`ps -ef|grep $APP_NAME|grep -v grep|grep -v kill|awk \'{print $2}\'`
if [ ${tpid} ]; then
    echo \'Kill Process!\'
    kill -9 $tpid
fi

 

注意修改

APP_NAME

 

分类:

技术点:

相关文章:

  • 2021-08-15
  • 2021-07-05
  • 2021-12-15
  • 2021-12-05
  • 2021-11-26
  • 2021-11-16
  • 2021-12-05
  • 2021-09-19
猜你喜欢
  • 2021-12-19
  • 2021-12-05
  • 2021-11-18
  • 2021-11-30
  • 2021-11-27
相关资源
相似解决方案