zoukankan      html  css  js  c++  java
  • Linux下设置tomcat开机自启

    #!/bin/bash

    # /etc/rc.d/init.d/tomcat
    #init script for tomcat precesses
    #
    #processname:tomcat
    #description:tomcat is a j2se server
    #chkconfig:2345 86 16
    #description:Start up the Tomcat servlet engine.
    if [ -f /et/init.d/functions ];then
    . /etc/init.d/functions
    elif [ -f /etc/rc.d/init.d/functions ]; then
    . /etc/rc.d/init.d/functions
    else
    echo -e "atomcat: unable to locate functions lib. Cannot continue."
    exit -1
    fi

    RETVAL=$?
    CATALINA_HOME="/opt/apache-tomcat-7.0.93"

    case "$1" in
    start)
    if [ -f $CATALINA_HOME/bin/startup.sh ];
    then
    echo $"Starting Tomcat"
    $CATALINA_HOME/bin/startup.sh
    fi
    ;;
    stop)
    if [ -f $CATALINA_HOME/bin/shutdown.sh ];
    then
    echo $"Stopping Tomcat"
    $CATALINA_HOME/bin/shutdown.sh
    fi
    ;;
    *)
    echo $"Usage: $0 {start|stop}"
    exit 1
    ;;
    esac

    exit $RETVAL

    -------------------------------------------------------------------------------------

    chmod 755 tomcat 给tomcat脚本文件添加执行权限
    chkconfig --add tomcat 给tomcat注册linux服务,配置这个tomcat在操作系统启动时就自动启动
    chkconfig --list

  • 相关阅读:
    Thymeleaf标签使用
    mybatis映射和条件查询
    开发模型
    Sentinel降级服务
    Sentinel
    Nacos注册中心
    SpringCloudAlibaba简介
    Sleuth
    Stream消息驱动
    如何用JAVA爬取AJAX加载后的页面(利用phantomjs)【以天眼查为例】
  • 原文地址:https://www.cnblogs.com/M-98k/p/11994985.html
Copyright © 2011-2022 走看看