• Dubbo服务启动脚本


    ## /usr/wangfajun/service/user
    
    #!/bin/sh
    
    ## java env
    export JAVA_HOME=/usr/java/jdk1.7.0_79
    export JRE_HOME=$JAVA_HOME/jre
    
    ## service name
    APP_NAME=user
    
    SERVICE_DIR=/home/wangfajun/service/$APP_NAME
    SERVICE_NAME=odao-weixin-$APP_NAME
    JAR_NAME=$SERVICE_NAME.jar
    PID=$SERVICE_NAME.pid
    
    cd $SERVICE_DIR
    
    case "$1" in
    
        start)
            nohup $JRE_HOME/bin/java -Xms256m -Xmx512m -jar $JAR_NAME >/dev/null 2>&1 &
            echo $! > $SERVICE_DIR/$PID
            echo "=== start $SERVICE_NAME"
            ;;
    
        stop)
            kill `cat $SERVICE_DIR/$PID`
            rm -rf $SERVICE_DIR/$PID
            echo "=== stop $SERVICE_NAME"
    
            sleep 5
            ##
            ## edu-service-aa.jar
            ## edu-service-aa-bb.jar
            P_ID=`ps -ef | grep -w "$SERVICE_NAME" | grep -v "grep" | awk '{print $2}'`
            if [ "$P_ID" == "" ]; then
                echo "=== $SERVICE_NAME process not exists or stop success"
            else
                echo "=== $SERVICE_NAME process pid is:$P_ID"
                echo "=== begin kill $SERVICE_NAME process, pid is:$P_ID"
                kill -9 $P_ID
            fi
            ;;
    
        restart)
            $0 stop
            sleep 2
            $0 start
            echo "=== restart $SERVICE_NAME"
            ;;
    
        *)
            ## restart
            $0 stop
            sleep 2
            $0 start
            ;;
    
    esac
    exit 0
    
     
    
     
  • 相关阅读:
    Generator函数介绍
    C语言基础三
    C语言基础二
    C语言基础一
    node——路由控制
    Node.js_HTTP模块
    node_Express安装及检验
    conda Pyhon版本切换
    JAVA泛型里面各值代表的意义
    jq实现表格多行列复制
  • 原文地址:https://www.cnblogs.com/wangfajun/p/8567306.html
Copyright © 2020-2023  润新知