summary of automatic starting of tomcat

From: Ramaswamy, Satish <>
Date: Tue Dec 03 2002 - 14:03:33 EST
i just exported the PATH variable today and i can't test it out until the eve/
late at night  today  when i can reboot the server.

also i've set and exported the PATH  variable in /etc/profile  which is read
first for the korn/bourne shells hence didn't feel the need of exporting the
PATH again in my script but have done so now.

-----Original Message-----
From: []
Sent: Tuesday, December 03, 2002 12:49 PM
To: Ramaswamy, Satish
Subject: Re: automatic starting of tomcat

You have to export the path since this is being run as a shell script,
hence it is running within a shell.  Anytime that you are writing a "shell
script" rather you are using sh, bash, tcsh or anything else, it is always
good practice to export your paths so that the shell will have the correct
envioronment variables that you expect it to have.

When it runs in the shell, the user of the shell, in this case root (?)
will use the default environment variables within /etc/skel/profile for the
path (which by the way is only /usr/bin and /usr/sbin i believe).

Question:  Did the script work correctly once you started exporting the
PATH variable to the shell process?  If so, then the proof is in the
pudding, as they say.

I hope that this helps.


Ryan Bishop
Sr. Unix Administrator/Security Administrator

"In three words I can sum up everything I've learned about life: It goes
on." -- Robert Frost

                    "Ramaswamy, Satish"
                    <Satish.Ramaswamy@uscel       To:
          >                    cc:     (bcc: Ryan
                    Sent by:                      Subject:     automatic
starting of tomcat

                    12/03/2002 12:51 PM

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

i've written a wrapper script called autotomcat as follows

#written by satish ramaswamy

export PATH #chang made 12/03/02
pscount=`ps -ef |grep "[j]ava"| wc -l`
#echo $pscount
if  [ $pscount -eq 0 ]; then
    cd $TOMCAT_HOME/bin
    #echo "inside if" start

i've tried couple of  things.
1)  renamed this script S98autotomcat and placed it in /etc/rc3.d/
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
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.

sunmanagers mailing list
sunmanagers mailing list
Received on Tue Dec 3 14:06:46 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:59 EST