tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Update: tomcat startup
@ 2004-08-10 15:43 Wakeman, Lindsay
  0 siblings, 0 replies; 2+ messages in thread
From: Wakeman, Lindsay @ 2004-08-10 15:43 UTC (permalink / raw)



   I have done some pretty exhaustive - and exhausting - tesing on this
little issue and I think I will probably give up at this stage. Further
things that were suggested by people(see ACK list below) included:
 
 		- add 'sleep' after the init startup call
 		- trap HUP in the init script
 		- trap HUP in all of the startup scripts (startup.sh,
catalina.sh)
 		- check the environment settings during startup are as
should be
 		- check Apache startup is after tomcat -  and after a delay
 		- check the shell is /bin/sh
 		- check the tomcat logs (always fails just before Coyote
server is started)
 		- check the symbolic links in /sbin/rc3.c etc.
 		- look at how HP Internet Express Apache is started for
comparison
 		- use the Java Service Wrapper (free)
 
  I have tried all of those but the last two. (On the Apache side, although
we run Apache on this system, it is not for the benefit of tomcat. I took
the Apache startup out 
altogether, to no avail.)
 
  The relevant extract of the init script now looks like this:
 
    <snip>
 			#!/bin/sh
 			trap 'echo tomcat_init >> /tmp/trap' 1
 			CATALINA_HOME=/web/tomcat
 			export CATALINA_HOME
 			JAVA_HOME=/usr/opt/java141
 			export JAVA_HOME
 
 
 			case "$1" in
				'start')
 
 		echo "Starting Tomcat...."
 		su - tcmgr -c "nohup $CATALINA_HOME/bin/startup.sh >
/tmp/tomcat_start.log &"
 		sleep 30
 		;;
    <snip>
 
  I get the expected tomcat startup lines in /tmp/tomcat_start.log. 
  Nothing ever arrives in /tmp/trap, including using the same trap in the
tomcat scripts.
 
 One interesting point I discovered is that whichever way I set up the init
script (either to run the startup as root, or to use 'su - application_user
-c' ) the net result is that it *always dumps core* when it terminates. This
is consistent with what happens if I start it manually after boot time, then
send it a HUP. So it suggests that a HUP is somehow getting through to the
final java invocation.  Perhaps I need to get a later JVM version. Ah well.
 
 Many thanks to : Narendra Raavi, Andy Wagg, Joachim Jaekel, Judith Reed Tom
Swigg, Joseph A. Senulis, John L.Lanier, Zoong Pham, Bevan Broun, and Oisin
McGuinness.

  I do appreciate it.
 	
  Cheers for now
 
       Lindsay


**************************************************************************

Experience the British Library online at www.bl.uk 

Help the British Library conserve the world's knowledge. Adopt a Book.
www.bl.uk/adoptabook 

*************************************************************************

The information contained in this e-mail is confidential and may be legally
privileged. It is intended for the addressee(s) only. If you are not the
intended recipient, please delete this e-mail and notify the
postmaster@bl.uk : The contents of this e-mail must not be disclosed or
copied without the sender's consent. 

The statements and opinions expressed in this message are those of the
author and do not necessarily reflect those of the British Library. The
British Library does not take any responsibility for the views of the
author. 

************************************************************************* 



^ permalink raw reply	[flat|nested] 2+ messages in thread
* Update: tomcat startup
@ 2004-08-03  9:31 Wakeman, Lindsay
  0 siblings, 0 replies; 2+ messages in thread
From: Wakeman, Lindsay @ 2004-08-03  9:31 UTC (permalink / raw)


  

Thanks to all those who replied: Tom Swigg, Joseph A. Senulis, John L.
Lanier, Zoong Pham, Bevan Broun - and especially to Oisin McGuinness who I
believe has explained what is wrong. And I apologise that I hadn't found his
similar response to this list before :-|

Here is his reply:

  
   " It is hard to be certain without seeing the details of the startup
script,
    but a common issue when moving startup scripts for applications
    that work on other Unixen to Tru64 Unix, is that the init process
    on Tru64 Unix will send anything started up by it a HUP signal
    after the startup. If your daemon (e.g. Apache is OK) can handle
    a HUP signal and either ignore it or reread the configuration file
    then that's OK, but if it is not handled, you have a problem.
    (Even though you have a nohup statement, I think you may find Tomcat
    is getting a HUP...)

    Very easy test: find the PID of your  running Tomcat server, and send it
HUP.
    If it goes down, you will need to add a signal handler somewhere.  "

 So, sending a HUP to my tomcat process does indeed prove that it cannot
handle it.

However, it isn't clear how to fix this, since init is running /bin/sh to
run
my startup script for tomcat, which in turn 'execs' the standard tomcat
startup scripts that come with the distro, which finally launches a JVM for
the tomcat server. 

I'm not running Apache, just the tomcat servlet server (Tomcat 4.1.1-27).
Tomcat starts up and works fine when invoked manually and has done for
months. This is a definite 'init' startup problem. I have all the symbolic
links set up in the rc directories, and the catalina.out log shows it
starting up.

 So I guess I'm left with 3 questions:

  1. Why does the 'nohup' command I am using not work?
  2. Has anyone successfully introduced a 'nohup' further down the line -
e.g. in the final catalina.sh script?
   3. Why does Tru64 init send HUPs anyway to child processes it has just
started?
  
 Thanks!

Lindsay

 PS I did originally include the whole script when posting to this list, but
the post was rejected as 'spam' (or similar)!

> -----Original Message-----
> From: Wakeman, Lindsay [mailto:Lindsay.Wakeman@bl.uk]
> Sent: 02 August 2004 14:30
> To: 'tru64-unix-managers@ornl.gov'
> Subject: tomcat startup
> 
> 
> 
>   Hello all,
>   
>    My apologies if this is a bit application-oriented. I have 
> been unable to
> get a script to work that will start up the Apache tomcat 
> server process on
> bootup (i.e. using init). The script I have tried most 
> recently works fine
> on a Solaris machine, but not on Tru64 (5.1A  patchkit 6). 
> The relevant line
> in the init.d script (which also sets JAVA_HOME) is:
> 
>     nohup $CATALINA_HOME/bin/startup.sh >  
> /tmp/tomcat_start.log 2>&1 &
> 
> 
>    The script works when it's called manually once the system 
> is up, but
> when invoked through init the process appears to disappear 
> very quickly. 
>   
>   I have searched for solutions and tried various suggested 
> in other circles
> to no avail.
>   
>   Has anyone managed to do this? If so can you tell me what 
> I'm doing wrong?
>   
>     TIA
>   
>      Lindsay
>   
>   Lindsay Wakeman
>   UNIX Systems Administrator, Applications Development South
>   The British Library
>   lindsay.wakeman@bl.uk
> 
>  
> 
> 
> **************************************************************
> ************
> 
> Experience the British Library online at www.bl.uk 
> 
> Help the British Library conserve the world's knowledge. Adopt a Book.
> www.bl.uk/adoptabook 
> 
> **************************************************************
> ***********
> 
> The information contained in this e-mail is confidential and 
> may be legally
> privileged. It is intended for the addressee(s) only. If you 
> are not the
> intended recipient, please delete this e-mail and notify the
> postmaster@bl.uk : The contents of this e-mail must not be 
> disclosed or
> copied without the sender's consent. 
> 
> The statements and opinions expressed in this message are those of the
> author and do not necessarily reflect those of the British 
> Library. The
> British Library does not take any responsibility for the views of the
> author. 
> 
> **************************************************************
> *********** 
> 


**************************************************************************

Experience the British Library online at www.bl.uk 

Help the British Library conserve the world's knowledge. Adopt a Book.
www.bl.uk/adoptabook 

*************************************************************************

The information contained in this e-mail is confidential and may be legally
privileged. It is intended for the addressee(s) only. If you are not the
intended recipient, please delete this e-mail and notify the
postmaster@bl.uk : The contents of this e-mail must not be disclosed or
copied without the sender's consent. 

The statements and opinions expressed in this message are those of the
author and do not necessarily reflect those of the British Library. The
British Library does not take any responsibility for the views of the
author. 

************************************************************************* 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-10 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-10 15:43 Update: tomcat startup Wakeman, Lindsay
  -- strict thread matches above, loose matches on Subject: below --
2004-08-03  9:31 Wakeman, Lindsay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox