#!/bin/bash # # tomcat Startup script for the Apache Tomcat Server # # chkconfig: - 85 15 # description: Apache Tomcat Server # processname: java # pidfile: /var/run/tomcat.pid # Source function library. . /etc/rc.d/init.d/functions export CATALINA_HOME=/usr/local/tomcat export JAVA_HOME=/usr/java/default export CATALINA_OPTS="-server -Xmx256m -Xms128m -Xss128k" export CATALINA_PID=/var/run/tomcat.pid RETVAL=0 catalina=$CATALINA_HOME/bin/catalina.sh start() { $catalina start RETVAL=$? return $RETVAL } stop() { if [ -f $CATALINA_PID ]; then $catalina stop -force rm $CATALINA_PID fi RETVAL=$? return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status -p $CATALINA_PID tomcat RETVAL=$? ;; restart) stop start ;; version) $catalina $@ RETVAL=$? return $RETVAL ;; *) echo $"Usage: $prog {start|stop|restart|status|version}" exit 1 esac exit $RETVAL |