Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Linux start, stop and restart the springboot jar package

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how Linux starts and stops restarting the springboot jar package". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how Linux starts and stops restarting the springboot jar package".

#! / bin/bash # can be replaced with your own execution program here, and other codes do not need to change the APP_NAME=mis-center-soa.jar # instructions to prompt the input parameter usage () {echo "Usage: sh my.sh [start | stop | restart | status]" exit 1} # check whether the program is running is_exist () {pid= `ps-ef | grep $APP_NAME | grep-v grep | awk'{print $2}'`# return 1 if it does not exist Return 0 if [- z "${pid}"] Then return 1 else return 0 fi} # Startup method start () {is_exist if [$?-eq "0]; then echo" ${APP_NAME} is already running. Pid=$ {pid}. " Else nohup java-jar / opt/app/spring-boot/mis-center-soa/$APP_NAME > / opt/logs/my.log 2 > & 1 & echo "${APP_NAME} start success" fi} # stop method stop () {is_exist if [$?-eq "0]; then kill-9$ pid else echo" ${APP_NAME} is not running "fi} # output running status status () {is_exist if [$?-eq" 0] Then echo "${APP_NAME} is running. Pid is ${pid} "else echo" ${APP_NAME} is NOT running. " Fi} # restart restart () {stop start} # according to the input parameters, select to execute the corresponding method. If you do not enter, execute the instructions case "$1" in "start") start;; "stop") stop;; "status") status;; "restart") restart;; *) usage;; esac

Thank you for reading, the above is the content of "how Linux starts and stops restarting springboot jar package". After the study of this article, I believe you have a deeper understanding of the problem of how Linux starts and stops restarting springboot jar package, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report