tomcat 5.5 startup script on Ubuntu server
- by Registered User
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.