zoukankan      html  css  js  c++  java
  • tomcat启动脚本

    author:headsen chen

    date:2018-04-10  16:05:05 

    [root@arch tomcat-oss]# cat tomcat.sh
    #!/bin/bash
    export JAVA_HOME=/opt/jdk1.7.0_45
    export JRE_HOME=${JAVA_HOME}/jre
    export CATALINA_HOME=/opt/tomcat-oss
    export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$CLASSPATH:${CATALINA_HOME}/lib
    #export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:${JAVA_HOME}/bin:${CATALINA_HOME}/bin
    export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:${JAVA_HOME}/bin:${CATALINA_HOME}/bin:/opt/apr/bin:/opt/apr-util/bin:/opt/apr-iconv/bin
    export LD_LIBRARY_PATH=/lib:/lib64:/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/opt/tnative/lib:/opt/apr/lib:/opt/apr-util/lib:/opt/apr-iconv/lib


    Tomcat_User=tomcat
    function start_server0 ()
    {
    su `echo $Tomcat_User` $CATALINA_HOME/bin/catalina.sh start
    }
    function stop_server0 ()
    {
    ID=`ps -ef | grep java | grep tomcat-oss|awk '{print $2}'`

    if [ -n "$ID" ]; then
    su `echo $Tomcat_User` $CATALINA_HOME/bin/catalina.sh stop
    else
    printf "no instance is running "
    fi

    for id in $ID
    do
    kill -9 $id
    echo "kill -9 $id"
    done
    }

    if [ "$1" = "start" ]; then
    start_server0
    elif [ "$1" = "stop" ]; then
    stop_server0
    else
    printf " server the options {start|stop} "

  • 相关阅读:
    失格
    救赎
    篝火晚会
    旅行家的预算
    荒诞
    mod
    clique
    序列
    [CF932E]Team Work & [BZOJ5093]图的价值
    NOIWC2018游记
  • 原文地址:https://www.cnblogs.com/kaishirenshi/p/8779980.html
Copyright © 2011-2022 走看看