On Thu, Jun 16, 2011 at 20:37, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Francis,
>
[...]
>
> The above requirements actually might not be possible in a reasonably
> simple system.
>
> First off, the JVM provides no pure-Java way of letting a process go
> into the background. So, there's really no opportunity to do some work
> in Java and /then/ return to the calling process without terminating.
>
> Second, an OS return code requires a process termination, and you
> certainly don't want to terminate the JVM you've just started.
>

I was actually wondering about these. I think I have my answer now :/
Solutions in C or other languages are many to achieve that, Java has
none.

> About the best we could do is change catalina.sh from roughly this:
>
> java org.apache.tomcat.Bootstrap >> logs/catalina.out &
>
> to this:
>
> java org.apache.tomcat.Bootstrap >> logs/catalina.out &
>
> tail -f logs/catalina.out | grep -m 1 "INFO: Server startup"
>
> exit 0
>
> There are some problems with this approach:
>
> 1. It's not foolproof... if your server is insanely fast, it might
>   start before tail | grep runs, and you might wait forever
>
> 2. The log messages are localized, so you'll have to use the proper
>   localized message instead of just "INFO: Server startup"
>
> 3. This is so simple that you should be able to do it yourself
>
> Does this really need to be a part of the stock Tomcat? I'm not
> convinced that this exact solution would meet everyone's needs so it
> would need to be further customized, anyway.
>

Yeah well, I can understand that since this is what I use right now. I
make it darn sure that my locale is set up OK, but then any different
logging configuration will defeat that. Which is why I am right now
switching over completely to the scenario where Tomcat only starts
with the manager webapp builtin and further webapps are deployed after
the initial startup. This still requires to parse the output of the
manager webapp, but at least it's better than the default :/

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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

Reply via email to