当前位置: > Linux服务器 > Tomcat >

tomcat 开机启动脚本

时间:2015-08-27 19:02来源:linux.it.net.cn 作者:IT

tomcat 开机启动脚本:

#!/bin/bash
#
# chkconfig: 2345 20 80
# description: Auto-starts tomcat
# /etc/init.d/tomcat
# chmod 755 tomcat
# cp tomcat /etc/init.d/
# ln -s /etc/init.d/tomcat /etc/rc.d/init.d/tomcat
# chkconfig --add tomcat
# chkconfig --level 2345 tomcat on 
# init script for tomcat precesses 

source /etc/profile

CATALINA_HOME="/usr/local/tomcat-7.0.47"
case $1 in
start)
        echo -n $"Starting Tomcat"
        $CATALINA_HOME/bin/startup.sh
        echo " done"
        ;;
stop)
        echo -n $"Stopping Tomcat"
        $CATALINA_HOME/bin/shutdown.sh
        echo " done"
        ;;
restart)
        echo $"Restarting Tomcat"
        $0 stop
        sleep 1
        $0 start
        echo " done"
        ;;
*)
        echo $"Usage: $0 {start|stop|restart}"
        ;;
esac

将此脚本保存在tomcat,然后放在/etc/init.d/目录下,注意要给此文件执行权限,chmod +x tomcat



(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容