我是靠谱客的博主 风趣小蚂蚁,这篇文章主要介绍springboot以jar包方式启动、关闭、重启脚本springboot以jar包方式启动、关闭、重启脚本,现在分享给大家,希望可以做个参考。

springboot以jar包方式启动、关闭、重启脚本

启动

编写启动脚本startup.sh

#!/bin/bash
echo Starting application 
nohup java -jar springboot_helloword-0.0.1-SNAPSHOT.jar &

 

授权

chmod +x startup.sh

 

关闭

编写关闭脚本stop.sh

 

#!/bin/bash
PID=$(ps -ef | grep springboot_helloword-0.0.1-SNAPSHOT.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill $PID
fi

 

授权

chmod +x stop.sh

 

重启

编写重启脚本restart.sh

 

#!/bin/bash
echo Stopping application
source ./stop.sh
echo Starting application
source ./startup.sh

 

授权

chmod +x restart.sh

 

转载于:https://www.cnblogs.com/zuidongfeng/p/9416294.html

最后

以上就是风趣小蚂蚁最近收集整理的关于springboot以jar包方式启动、关闭、重启脚本springboot以jar包方式启动、关闭、重启脚本的全部内容,更多相关springboot以jar包方式启动、关闭、重启脚本springboot以jar包方式启动、关闭、重启脚本内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(110)

评论列表共有 0 条评论

立即
投稿
返回
顶部