automatic starting of tomcat

From: Ramaswamy, Satish (Satish.Ramaswamy@uscellular.com)
Date: Tue Dec 03 2002 - 12:51:45 EST


hi, i have a solaris e-450 server and each time i'd like to find out how to
start tomcat automatically when the server reboots.

i've written a wrapper script called autotomcat as follows

#!/bin/sh
#written by satish ramaswamy
TOMCAT_HOME=/export/home/webmstr/jakarta-tomcat-3.3
export TOMCAT_HOME
PATH=/usr/bin:/usr/sbin:/usr/dt/bin:/usr/openwin/bin:/usr/ucb:$TOMCAT_HOME/bi
n:.
export PATH #chang made 12/03/02
cd $TOMCAT_HOME/bin
pscount=`ps -ef |grep "[j]ava"| wc -l`
#echo $pscount
if [ $pscount -eq 0 ]; then
    cd $TOMCAT_HOME/bin
    #echo "inside if"
    tomcat.sh start
fi

i've tried couple of things.
1) renamed this script S98autotomcat and placed it in /etc/rc3.d/ directory
but this doesn't seem to work when the server reboots.
2) in cron 10,20,30,40,50 * * * * /scripts/autotomcat > /dev/null have the
script called every 10 minutes. the reason i do this is because i have a
backup script and don't know how long the backup takes and at the end i
reboot the server.

but this didn't work either. however, i changed my autotomcat script and am
now exporting the PATH but i don't see why i should since i'm not using
the variables in the script outside the script.

thanks in advance.

satish
ph:630-875-8263
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:24 EDT