You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brett Perkes <bp...@xmission.com> on 2001/02/01 23:12:59 UTC

starting Tomcat at boot time on Linux

I can start Tomcat from the command line and it continues to run great, even
runs my servlets nicely.  My problem is that when I start it at boot time it
runs for a short period of time and then dies.  I'm curious if there is a
some sort of log file or listing that I can read in order to get an idea of
why the program quits.

I have included the start up script that is called at boot time for
reference.  Any help is very appreciated.

Brett Perkes


Start up script:

#!/bin/sh
# Start Tomcat

export TOMCAT_HOME=/usr/jakarta/dist

case "$1" in
'start')
    $TOMCAT_HOME/bin/tomcat.sh start
    ;;
'stop')
    $TOMCAT_HOME/bin/tomcat.sh stop
    ;;
*)
    echo "Usage: $0 {start | stop }"
    ;;
esac
exit 0


Re: starting Tomcat at boot time on Linux

Posted by Jeff Turner <je...@socialchange.net.au>.
I suggest you use the tomcat startup script that comes with the Tomcat RPMs 
(http://rpmized.free.fr). 

When run from the command-line, "tomcat start" print stuff to stdout/stderr. 
However, when run from an init script, this output is lost[*], so you won't 
be able to tell why Tomcat dies occasionally. 

A quick fix is to change the line:

 $TOMCAT_HOME/bin/tomcat.sh start

to: 
 initlog -c "tomcat run" >/var/tomcat/logs/stdout 2>/var/tomcat/logs/stderr &

--Jeff


[*] Exactly *why* it's lost involves a bug in the "initlog" program. Y'see, 
"tomcat start" starts the Tomcat process with a '&', pushing it into the 
background. For some reason, messages produced by such background processes 
don't make it to initlog. If you use 'tomcat run', the output is part of the 
'tomcat' script process, and so initlog captures the output and sends it to 
/var/log/messages.


On Fri,  2 Feb 2001 09:12, Brett Perkes wrote:
> I can start Tomcat from the command line and it continues to run great,
> even runs my servlets nicely.  My problem is that when I start it at boot
> time it runs for a short period of time and then dies.  I'm curious if
> there is a some sort of log file or listing that I can read in order to get
> an idea of why the program quits.
>
> I have included the start up script that is called at boot time for
> reference.  Any help is very appreciated.
>
> Brett Perkes
>
>
> Start up script:
>
> #!/bin/sh
> # Start Tomcat
>
> export TOMCAT_HOME=/usr/jakarta/dist
>
> case "$1" in
> 'start')
>     $TOMCAT_HOME/bin/tomcat.sh start
>     ;;
> 'stop')
>     $TOMCAT_HOME/bin/tomcat.sh stop
>     ;;
> *)
>     echo "Usage: $0 {start | stop }"
>     ;;
> esac
> exit 0
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org

Re: starting Tomcat at boot time on Linux

Posted by Geoff Lane <gl...@inclusion.net>.
try appending an '&' to the end of your start line. That will fork the
process to the background. Sometimes when you don't do that and you log
out, the process will stop. Worth a shot . . .


Brett Perkes wrote:
> 
> I added a line to export JAVA_HOME and still get the same results.  Any
> other ideas?
> 
> ----- Original Message -----
> From: "Kevin Sangeelee" <ke...@susa.net>
> To: <to...@jakarta.apache.org>; "Brett Perkes" <bp...@xmission.com>
> Sent: Thursday, February 01, 2001 3:23 PM
> Subject: Re: starting Tomcat at boot time on Linux
> 
> I noticed that while you set TOMCAT_HOME, you didn't set JAVA_HOME. Could
> it be that Tomcat is using the wring JVM (i.e. kaffe that's installed by
> some distributions)?
> 
> On Thu, 1 Feb 2001, Brett Perkes wrote:
> 
> > I can start Tomcat from the command line and it continues to run great,
> even
> > runs my servlets nicely.  My problem is that when I start it at boot time
> it
> > runs for a short period of time and then dies.  I'm curious if there is a
> > some sort of log file or listing that I can read in order to get an idea
> of
> > why the program quits.
> >
> > Start up script:
> >
> > export TOMCAT_HOME=/usr/jakarta/dist
> >
> > case "$1" in

-- 
Geoff Lane <gl...@inclusion.net>

Re: starting Tomcat at boot time on Linux

Posted by Brett Perkes <bp...@xmission.com>.
I added a line to export JAVA_HOME and still get the same results.  Any
other ideas?


----- Original Message -----
From: "Kevin Sangeelee" <ke...@susa.net>
To: <to...@jakarta.apache.org>; "Brett Perkes" <bp...@xmission.com>
Sent: Thursday, February 01, 2001 3:23 PM
Subject: Re: starting Tomcat at boot time on Linux


I noticed that while you set TOMCAT_HOME, you didn't set JAVA_HOME. Could
it be that Tomcat is using the wring JVM (i.e. kaffe that's installed by
some distributions)?

On Thu, 1 Feb 2001, Brett Perkes wrote:

> I can start Tomcat from the command line and it continues to run great,
even
> runs my servlets nicely.  My problem is that when I start it at boot time
it
> runs for a short period of time and then dies.  I'm curious if there is a
> some sort of log file or listing that I can read in order to get an idea
of
> why the program quits.
>
> Start up script:
>
> export TOMCAT_HOME=/usr/jakarta/dist
>
> case "$1" in


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org




Re: starting Tomcat at boot time on Linux

Posted by Kevin Sangeelee <ke...@susa.net>.
I noticed that while you set TOMCAT_HOME, you didn't set JAVA_HOME. Could
it be that Tomcat is using the wring JVM (i.e. kaffe that's installed by
some distributions)?

On Thu, 1 Feb 2001, Brett Perkes wrote:

> I can start Tomcat from the command line and it continues to run great, even
> runs my servlets nicely.  My problem is that when I start it at boot time it
> runs for a short period of time and then dies.  I'm curious if there is a
> some sort of log file or listing that I can read in order to get an idea of
> why the program quits.
> 
> Start up script:
> 
> export TOMCAT_HOME=/usr/jakarta/dist
> 
> case "$1" in