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: Ryan.Bishop@exim.gov [mailto:Ryan.Bishop@exim.gov] 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: <sunmanagers@sunmanagers.org> lular.com> cc: (bcc: Ryan Bishop/IMT/EXIMBANK) Sent by: Subject: automatic starting of tomcat sunmanagers-admin@sunma nagers.org 12/03/2002 12:51 PM 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 _______________________________________________ sunmanagers mailing list sunmanagers@sunmanagers.org http://www.sunmanagers.org/mailman/listinfo/sunmanagersReceived 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