-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eugene,

On 4/13/2010 7:18 AM, Mirgorodskiy Eugene wrote:
> I apologise if this theme described in documentation Tomcat, I badly
> understand English language.
>
> Whether you could not answer me is in tomcat 6.0.X Service which
> automatically would start Tomcat, at end of its work as a result of
> an error or failure in software work.

Tomcat does not provide this service. There may be such services
available elsewhere, but I am unaware of them.

You may be able to create your own, something like this:

#!/bin/sh

CATALINA_HOME=/opt/tomcat6
CHECK_INTERVAL=30s
RESTART_INTERVAL=10s

while true ; do
  # Start TC in background
  "${CATALINA_HOME}/bin/catalina.sh" start

  # Repeatedly check stdout for errors
  while true ; do
    sleep ${CHECK_INTERVAL}
    grep OutOfMemoryError "${CATALINA_HOME}/logs/catalina.out"

    result = $?
    if [ "0" == "${result}" ] ; then
      break
    fi
  done

  # Stop TC
  "${CATALINA_HOME}/bin/catalina.sh" stop
  sleep ${RESTART_INTERVAL}
done

This will run Tomcat forever and restart it if any OutOfMemoryError
messages are emitted to logs/catalina.out.

You can certainly customize this to meet whatever other needs you may
have. You can even have your webapp dump something into stdout (or some
other file) and check that, too.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvEndIACgkQ9CaO5/Lv0PDORQCfcTUbMHXMqiNFLPvRl7Spfnzg
erAAoI1r5JnHFLVpmg0PereR4yBBzTAU
=/1/r
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to