将tomcat部署成为自动运行的服务
#chkconfig tomcat on
启动服务
#service tomcat start
查询服务状态
#service tomcat status
停止服务
#service tomcat stop作者: 翔子 时间: 2011-5-7 00:40 标题: tomcat6服务脚本(jsvc) #!/bin/sh
#
# Startup script for Tomcat, the Apache Servlet Engine
#
# chkconfig: 345 80 20
# description: Tomcat is the Apache Servlet Engine
# processname: tomcat
# pidfile: /var/run/tomcat.pid
#
# Mike Millson <*******@meritonlinesystems.com>
#
# version 1.02 - Clear work directory on shutdown per John Turner suggestion.
# version 1.01 - Cross between Red Hat Tomcat RPM and Chris Bush scripts
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
# Ugly hack
# We should really make sure tomcat
# is stopped before leaving stop
sleep 5
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac