tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: One process per webapp
Date Tue, 14 Jun 2011 18:16:41 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pid,

On 6/14/2011 9:34 AM, Pid wrote:
> On 13/06/2011 22:53, Christopher Schultz wrote:
>>
>> What "single management interface" are you describing in your
>> enhancement comments? The Tomcat manager webapp? It's trivial to run a
>> manager in each JVM and use that for deployment.
>>
>> If you know that your webapp needs to do things such as register a
>> shared library on startup, you can do one of two things:
>>
>>   1. Always bounce Tomcat directly instead of re-loading the webapp
>>   2. Fix the webapp so it doesn't bomb on startup when the library
>>      is already loaded
>>
>> Tomcat provides the manager webapp and ant tasks to access it, plus a
>> toolbox of scripts to start/stop/etc. Tomcat. Your needs seem to be
>> fairly specific... why not just roll your own solution?
> 
> Bouncing a JVM requires admin access to the local operating system,
> which you probably wouldn't want to give to a Tomcat application.

Not necessarily... we run Tomcat unprivileged so bouncing the JVM just
requires "normal" user access. If you need port 80, use jsvc or one of
the other similar options.

Now, bouncing the JVM from withing the JVM... that requires some creativity.

It sounds like the OP could just wrap the Tomcat launcher in a script
that looks roughly like this:

#/bin/sh

while [ 1 ]
do
  ${CATALINA_HOME}/bin/startup.sh run >> "$CATALINA_OUT" 2>&1
done

This would start a Tomcat and wait for it to finish, then restart when
the original JVM came down. I suspect using JMX or whatever, one can
request a Tomcat shutdown which will ultimately terminate the JVM
(unless some foolish person launched a non-daemon thread at some point).
The script will re-start Tomcat.

This just doesn't seem like a difficult thing to implement oneself, nor
does it seem like something that is widely applicable.

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

iEYEARECAAYFAk33pYkACgkQ9CaO5/Lv0PC8SACfVOfOhDAvgLzv6bdlKnzVJ96i
k50AnRi3Si75/+E1j0ME/YMQESVcFdbY
=jcbN
-----END PGP SIGNATURE-----

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


Mime
View raw message