tomcat 5.5 startup script on Ubuntu server

Posted by Registered User on Server Fault See other posts from Server Fault or by Registered User
Published on 2011-02-17T08:01:07Z Indexed on 2011/02/25 7:26 UTC
Read the original article Hit count: 536

Filed under:
|

Can any one share their Tomcat startup script I am looking for a tomcat start up script on a Ubuntu machine. My Ubuntu is 10.04 server. The tomcat is 5.5.30.

It is in /opt/apache-tomcat-5.5.31

I tried a script

#!/bin/bash
#
# tomcat
#
# chkconfig:
# description: Start up the Tomcat servlet engine.

# Source function library.
. /lib/lsb/init-functions


RETVAL=$?
CATALINA_HOME="/opt/apache-tomcat-5.5.31"

case "$1" in
start)
if [ -f $CATALINA_HOME/bin/startup.sh ];
then
echo $"Starting Tomcat"
/opt/apache-tomcat-5.5.31/bin/startup.sh

fi
;;
stop)
if [ -f $CATALINA_HOME/bin/shutdown.sh ];
then
echo $"Stopping Tomcat"
/opt/apache-tomcat-5.5.31/bin/shutdown.sh
fi
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
;;
esac
exit $RETVAL 

but it did not worked after a reboot. But the same script works if I do /etc/init.d/tomcat start or /etc/init.d/tomcat stop I have done
update-rc.d tomcat defaults
as it is a Ubuntu server but on reboot all of this fails to work.

© Server Fault or respective owner

Related posts about ubuntu-10.04

Related posts about tomcat5.5