tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angel, Ronald J" <rjan...@switch.com>
Subject RE: Who starts tomcat??
Date Thu, 24 Jan 2002 12:43:43 GMT
	Nice job on the script John.

	One comment about runlevels & rc.X directories for linux users
though...
	It appears to differ from Solaris a bit.


> 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.
> 
	Most linux systems use either run level 3 or 5 for normal
operations.
	 3 - Normal operations
	 5 - Normal operations w/ X-Windows login

	So basically use John's 'ln' command above from the rc3.d & rc5.d
directories also.

	One final note, the scripts (via the links) are executed in
increasing servicename order.
	(S00, S05, S10, S15,...) so keep this in mind if you have any
dependincies.  Multiple
	scripts with the same servicename (number) don't appear to be a
problem, but, there
	is no guarantee which will be executed first.

> 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
>  
> 
> 

--
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