#!/bin/sh
#chkconfig: 2345 96 14
JAVA_HOME=/usr/local/jdk
CATALINA_HOME=/usr/local/webserver/jenkins
export JAVA_HOME CATALINA_HOME
case $1 in
start)
exec $CATALINA_HOME/bin/catalina.sh start ;;
stop)
exec $CATALINA_HOME/bin/catalina.sh stop ;;
restart)
$CATALINA_HOME/bin/catalina.sh stop
sleep 4
exec $CATALINA_HOME/bin/catalina.sh start ;;
configtest)
exec $CATALINA_HOME/bin/catalina.sh configtest ;;
*)
echo "Usage: basename $0
{start|stop|restart}"
exit 1 ;;
esac
chkconfig add tomcat.jenkins
chkconfig on tomcat.jenkins
service tomcat.jenkins stop/restart/reart/configtest
原文:http://blog.51cto.com/study2008/2089539