Linux下将Tomcat设置为Chkconfig启动方式
#!/bin/sh
#
# tomcat: Start/Stop/Restart tomcat
#
# chkconfig: 35 99 8
# description:Tomcat for web at /opt/tomcat6
#
#
export CATALINA_BASE=/opt/tomcat6
export CATALINA_HOME=/opt/tomcat6
export CATALINA_TMPDIR=/opt/tomcat6/temp
export JAVA_OPTS='-Xms500M -Xmx2500M -server'
#Source function library.
./etc/rc.d/init.d/functions
TOMCAT=/opt/tomcat6
start(){
echo -n "Starting Tomcat:"
$TOMCAT/bin/catalina.sh start
}
stop(){
echo -n "Stopping Tomcat:"
$TOMCAT/bin/catalina.sh stop
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo " Usage $0 {start|stop|restart}"
;;
esac
exit $RETVAL
#chkconfig --add *****