cat > /etc/init.d/tomcat << "EOF" #!/bin/bash # # tomcat # # chkconfig: # description: Start up the Tomcat servlet engine. RETVAL=$? CATALINA_HOME="/usr/local/tomcat" case "$1" in start) if [ -f $CATALINA_HOME/bin/startup.sh ]; then echo $"Starting Tomcat" /bin/su - tomcat -c $CATALINA_HOME/bin/startup.sh fi ;; stop) if [ -f $CATALINA_HOME/bin/shutdown.sh ]; then echo $"Stopping Tomcat" /bin/su - tomcat -c $CATALINA_HOME/bin/shutdown.sh fi ;; *) echo $"Usage: $0 {start|stop}" exit 1 ;; esac exit $RETVAL EOF