六笨哥
分类: LINUX
2008-03-28 11:07:24
JAVA_HOME=/usr/java/jdk1.5.0_14
export JAVA_HOME
CATALINA_HOME=/opt/tomcat
export CATALINA_HOME
case "$1" in
start)
echo "Starting Tomcat ..."
sleep 2
$CATALINA_HOME/bin/startup.sh
;;
stop)
echo "Stop Tomcat ..."
sleep 2
$CATALINA_HOME/bin/shutdown.sh
;;
restart)
echo "restarting tomcat"
$0 stop
$0 start
;;
*)
echo "Usage: $1 {start|stop}"
;;
esac
exit 0
保存添加可执行
chmod a+x /etc/rc.d/init.d/tomcatd
加入启动项
chkconfig --add tomcatd
chkconfig --list tomcatd
查看一下
这样就可以了 reboot linux