linux tomcat 開機自啓動

#!/bin/sh
# chkconfig: 2345 10 90
# description: Start and Stop redis

# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.

export CATALINA_HOME=/opt/tomcat8/

case "$1" in
start)
        ${CATALINA_HOME}/bin/startup.sh
        exit 0
        ;;
stop)
        ${CATALINA_HOME}/bin/shutdown.sh
        exit 0
        ;;
debug)
        ${CATALINA_HOME}/bin/shutdown.sh
        ${CATALINA_HOME}/bin/catalina.sh run
        exit 0
        ;;
force-reload|restart)
        ${CATALINA_HOME}/bin/startup.sh
        ${CATALINA_HOME}/bin/shutdown.sh
        exit 0
        ;;
 
*)
        echo "Usage: /etc/init.d/tomcat {start|stop|restart|force-reload|debug}"
        exit 1
        ;;
esac
exit 0
cp tomcat /etc/init.d/tomcat
chmod 777 /etc/init.d/tomcat
echo "service tomcat start" >> /etc/rc.d/rc.local

chkconfig --add tomcat
chkconfig tomcat on
chkconfig --list  
chmod +x /etc/rc.d/rc.local

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章