ubuntu下tomcat开机启动脚本

  |   0 评论   |   1,461 浏览

    1.需要在/etc/init.d下面新建tomcat启动脚本
    #!/bin/sh #tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid

    export JAVA_HOME=/opt/jdk18025

    case $1 in
    start)
    sh /opt/tomcat7/bin/startup.sh
    ;;
    stop)
    sh /opt/tomcat7/bin/shutdown.sh
    ;;
    restart)
    sh /opt/tomcat7/bin/shutdown.sh
    sh /opt/tomcat7/bin/startup.sh
    ;;
    *)
    echo ‘Usage:tomcat start|stop|restart’
    ;;
    esac

    exit 0

    1. sysv-rc-conf tomcat on
    也可以使用
    Java代码 收藏代码
    1. update-rc.d tomcat6 defaults
    2. update-rc.d tomcat6 remove
    500fd9f9d72a605905b2fa102a34349b033bba1d

    评论

    发表评论

    validate