tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Wadkin <j.wad...@hud.ac.uk>
Subject RE: Who starts tomcat??
Date Wed, 23 Jan 2002 12:27:40 GMT
Thought this explanation might be useful to anyone who, like me, is knew to
Unix and scripting... Hence, apologies for any inaccuracies! Took me a bit
to fathom all this out! I guess it expands on Ron's explanation.

The format of the script in init.d looks something like this:

#!/bin/sh
#Start TC
#
case "$1" in
start)
echo "Starting TomCat 4"
su - nocat -c "usr/local/tomcat/bin/startup.sh"
;;
stop)
echo "Stopping TomCat 4"
su - nocat -c "/usr/local/tomcat/bin/shutdown.sh"
;;
restart)
;;
esac

When a Unix box boots the init process passes "start" to the script,
conversely on shutdown it passes "stop". In the rc0.d directory a sym. link:

ln -s ../init.d/<nameofscript> <Kxxservicename>

is needed where xx is a number up to 99 and <servicename> is a meaningful
name. In the rc2.d directory a sym. link:

ln -s ../init.d/<nameofscript> <Sxxservicename>

is also needed. Note the K and S - K for kill and S for start. Everything in
rc0.d is executed with value "stop" when the machine hits run-level 0
(shutdown) and everything in rc2.d is executed with value "start" when the
machine hits run-level 2 (multi-user). There are other rc directories - e.g.
6 for reboot - but 0 and 2 should be enough.

Seems to work fine on Solaris 8. Note that the env. variables CATALINA_HOME
and JAVA_HOME are set in catalina.sh.

Thanks,
 
John
 
Quote for the week:
 
The men with the muck-rakes are often indispensable to the well-being of
society; but only if they know when to stop raking the muck.
 
Theodore Roosevelt, Speech in New York, 11 Nov. 1902
 


-----Original Message-----
From: E B [mailto:hello1790@yahoo.co.uk]
Sent: 22 January 2002 04:37
To: Tomcat Users List
Subject: Re: Who starts tomcat??


 --- John Kolvereid <odin@op.net> wrote: > Hi,
>     This is exactly what I had done previously.  I
> might add that it works like
> a charm for Oracle, and other programs on our
> system.  However, when I tried the
> same thing for Tom it has never open automatically -
> no matter where I place it
> in the init list.  I tried
>         $CATALINA_HOME/bin/startup.sh
> and
>         /home/down/jakarta-tomcat-4.0/bin/startup.sh
> and the same for
>         su root -c...
> and
>         su -c...
> None of these seem to work.  I have no idea why. 
> Any advise?  Thanks.
> 
> 

Is this command really executed?
Did you set JAVA_HOME, and does startup.sh see this
variable? What do the logs show? catalina.out?


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message