zoukankan      html  css  js  c++  java
  • java程序启动、停止、重启脚本

    一、启动脚本start.sh

    #!/bin/sh
    isExist=`ps -ef | grep MonitorAndImprove | grep -v grep | awk '{print $2}'`
    if [ ! -z "$isExist" ]; then
        echo "process already running!!! pid is "$isExist
        exit -1
    fi
    PRGDIR=`dirname "$0"`
    BASEDIR=`cd "$PRGDIR" ; pwd`
    CLASSPATH=$BASEDIR/config:$BASEDIR/lib/*
    nohup java -Xmx2g -Xms2g -classpath "$CLASSPATH" 
         com.tencent.apd.MonitorAndImprove 
    > log/out.log 2>& 1 &
    echo $! > progressId.pid

    二、停止脚本stop.sh

    #!/bin/sh
    if [ -f "progressId.pid" ] ; then
        kill -9 `cat progressId.pid`
        rm progressId.pid
    fi
    isExist=`ps -ef | grep MonitorAndImprove | grep -v grep | awk '{print $2}'`
    if [ ! -z "$isExist" ]; then
        kill -9 $isExist
    fi


    三、重启脚本restart.sh

    #!/bin/sh
    sh stop.sh
    sh start.sh


     
    ————————————————
    版权声明:本文为CSDN博主「cxy1991xm」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/cxy1991xm/article/details/90447631

  • 相关阅读:
    timeDate.js 插件优化
    向页面中插入不同格式的时间(timeDate.js)
    html
    html
    html
    html
    three.js
    three.js
    three.js
    python之路_头像预览、each循环及form组件校验验证码
  • 原文地址:https://www.cnblogs.com/zenghansen/p/12795962.html
Copyright © 2011-2022 走看看