zoukankan      html  css  js  c++  java
  • shell 脚本启动spring boot的jar 包

    #!/bin/bash
    
    
    # kill java进程
    java_sso_prod_pid=`ps aux|grep sso.jar|grep -v "grep"|awk '{print $2}'`
    
    if [ "$java_sso_prod_pid" ];then
        ps aux|grep sso.jar|grep -v "grep"|awk '{print $2}'|xargs kill -9
        echo -e "33[32m[ old javar sso prod  process  is killed ]33[0m"
    fi
    
    
    #重启java进程
    source /etc/profile
    
    nohup java -jar sso.jar  -Xms512m -Xmx2048m --spring.profiles.active=prod --server.port=8080 >>/home/deploy/sso-boot-prod/sso_jar.log  &
    
    sleep 5
    
    java_process=` ps aux|grep sso.jar|grep -v "grep"|awk '{print $2}' `
    
    echo $java_process
    
    if [ "$java_process" ];then
              echo -e "33[32m[ java sso  process  started success on prod  env !  ]33[0m"
    fi
    

      

  • 相关阅读:
    AC自动机学习笔记(模板)
    codeforces1328E
    Codeforces 1288E- Messenger Simulator (树状数组)
    线性基小记
    HDU3949
    矩阵快速幂小记
    5E
    5D
    5C
    5B
  • 原文地址:https://www.cnblogs.com/weifeng1463/p/10172891.html
Copyright © 2011-2022 走看看