Para seguir con los tips de servicios en ubuntu, adjunto el script de inicializacion como servicio de tomcat, es necesario adaptar las rutas a su propia configuracion, es el resultado de un par de modificaciones sobre el original, para configurarlo como servicio, se pueden usar las instrucciones de un post anterior.
# This is the init script for starting up the
# Jakarta Tomcat server 6
#
# description: Starts and stops the Tomcat daemon.
#
tomcat=/usr/local/share/apache-tomcat-6.0.18/
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh
user=tomcat
export JAVA_OPTS="-Xms512m -Xmx512m"
export JAVA_HOME=/usr/lib/jvm/java-6-sun/
start(){
echo -n $"Starting Tomcat service: "
#daemon -c
#su - $user -c $startup
$startup
RETVAL=$?
echo
}
stop(){
echo -n $"Stopping Tomcat service: "
#daemon -c
#su - $user -c $shutdown
$shutdown
RETVAL=$?
echo
}
restart(){
stop
start
}
status(){
numproc=`ps -ef | grep catalina | grep -v "grep catalina" | wc -l`
if [ $numproc -gt 0 ]; then
echo "Tomcat is running..."
else
echo "Tomcat is stopped..."
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status tomcat
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0