On Wed, 12 Sep 2001, Jonathan Eric Miller wrote:

> Date: Wed, 12 Sep 2001 23:57:07 -0500
> From: Jonathan Eric Miller <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: The pitfalls in restarting tomcat
>
> I agree that there should be a restart.sh. However,  it is possible to
> restart/reload a servlet without having to stop and start Tomcat, in version
> 4 that is, which is due for release any day now. I think you can do it in
> Tomcat 3 as well. In 4, you can mark a Context as reloadable. Then, it will
> check the files when they are requested, and if the time stamp is new, then,
> it will automatically reload the servlet. Also, there is a management
> servlet that allows you to restart other servlets in case you don't want to
> have auto-reloading on.
>
> Nonetheless, I still think a restart.sh command would be useful.
>

In Tomcat 4, you can also use the Manager webapp to restart a particular
app at any time (whether or not you have declared it to be reloadable)
through an HTTP request like:

  http://localhost:8080/manager/reload?path=/exmaples

This can also be scripted into shell scripts if you need to restart
periodically for some reason (such as to switch log files).

For more info, see

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.html

> Jon
>

Craig

> ----- Original Message -----
> From: "Jeff Turner" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, September 09, 2001 9:55 PM
> Subject: The pitfalls in restarting tomcat
>
>
> > Hi,
> >
> > I was wondering how people who use Tomcat every day) do the stop/start
> > cycle that's required whenever something in WEB-INF/lib changes.
> >
> > "./shutdown.sh ; ./startup.sh" is a bad idea, because Tomcat 3.x seems
> > to shut down it's threads asynchronously. So after shutdown.sh has
> > returned, Tomcat has not necessarily stopped. Then startup.sh comes
> > along, finds that your port is in use, and gives you "Address already in
> > use" errors.
> >
> > With Tomcat 3.3, it is very easy to confuse Tomcat into thinking that it
> > has shut down (the ajp12.id file does not exist), but it actually
> > running. In this (common) situation, there is no way to kill tomcat
> > other than killing the processes ('killall java'). Killing tomcat in
> > this way is *very* dangerous, because it sometimes leaves threads in the
> > state described by 'man ps' as:
> >
> >       D   uninterruptible sleep (usually IO)
> >
> > Then you're plain screwed; the thread is completely unkillable even by
> > root, and is holding onto your tomcat port (8080). The only option is to
> > reboot the machine.
> >
> > So anyway, has anyone got a safer way of restarting tomcat? Perhaps a
> > script that waits until Tomcat is *really* dead before restarting? It
> > would be nice if there was direct support in Tomcat for this everyday
> > task (a restart.sh script).
> >
> > --Jeff
> >
>
>

Reply via email to