zoukankan      html  css  js  c++  java
  • (四)Springboot以jar包方式启动、关闭、重启脚本

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

    SpringBoot:
    nohup java -jar zlkj-data-server-1.0-SNAPSHOT.jar --spring.profiles.active=prod > /usr/local/program/jgp.log &
    
    Java:
    nohup java -jar JT808.jar > /usr/local/program/JT808.log &
    

    1、启动

    编写启动脚本startup.sh:

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

    2、关闭

    编写关闭脚本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
    

    3、重启

    编写重启脚本restart.sh:

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

    4、脚本授权

    chmod +x startup.sh
    
  • 相关阅读:
    Skimage=scikit-image SciKit 包的模块(转载)
    python day12
    python day11
    python day10
    python day9
    python day8
    python day7
    python day6
    python 第五天
    python 第四天
  • 原文地址:https://www.cnblogs.com/aixing/p/13327109.html
Copyright © 2011-2022 走看看