On Thursday 15 July 2010 20:26:14 Christopher Schultz wrote:
> Rainer,

Hi, and sorry for the late reply.

[I changed the order of some parts of your mail to reply 

> On 7/12/2010 9:14 AM, Rainer Frey wrote:
> > I understand that, but would it be possible/good/not causing problems to
> > change this to do CATALINA_BASE="$CATALINA_HOME first, so a setenv.sh can
> > rely on CATALINA_BASE being set?
> 
> I think I understand the source of the confusion, here:
> 
> 1. you want CATALINA_BASE to be set before CATALINA_HOME/bin/setenv.sh
>    is invoked

yes.

> 2. CATALINA_BASE must be set to something other than CATALINA_BASE
>    in order for CATALINA_BASE/bin/setenv.sh to be invoked /at all/

Detecting the right setenv.sh works fine, so I don't care about that.

> 3. case here is that CATALINA_HOME/bin/setenv.sh is being used,
>    but you want to use CATALINA_BASE/[something] in your generic scripts

Exactly.

> if [ -n "${CATALINA_BASE}" ] ; then
>   THE_BASE_DIR="${CATALINA_BASE}"
> else
>   THE_BASE_DIR="${CATALINA_HOME}"
> fi
[...]
> CONF_DIR="${THE_BASE_DIR}/conf"

Thanks for the hint, I'm doing exactly that now.

> I'm not sure a patch is necessary, since the script has all the
> information it needs. Perhaps your script will have to be a bit more
> verbose (for instance, by explicitly testing for CATALINA_BASE), but it
> is certainly not prohibited from doing it's own work.

That's absolutely right. A patch certainly is not necessary. My thought behind 
the question was just: would it be better to solve this once for everybody by 
changing catalina.sh, instead of let everybody handle that in their own 
script?

> if a user is going to use CATALINA_BASE, it
> must be set before any scripts are called, otherwise CATALINA_BASE
> doesn't get used at all (and CATALINA_HOME is the appropriate location
> of whatever configuration files you want to use).
> 
> There will be cases where CATALINA_BASE is not set at all, and therefore
> essentially defaults to CATALINA_HOME. 

Well, actually, from a few lines down in catalina.sh, CATALINA_BASE *is* 
always set (to the value of CATALINA_HOME if not set to anything else). The 
rest of the script *does* use CATALINA_BASE unconditionally, and it is used to 
set the catalina.base system property which *is* always used by Tomcat 
internally. 

> It's probably a good thing for setenv.sh to be able to determine whether
> CATALINA_BASE is explicitly set

I did not think I'd ever need this, that's why I asked for other opinions. In 
that case my proposed change is undesirable.
>
> Does your setenv.sh script expect to use a default file
> (CATALINA_HOME/conf/whatever.jmx) and allow it to be overridden in
> CATALINA_BASE/conf/whatever.jmx? 

No, though it might be a good idea after all. My original plan was to use one 
separate file per instance, no matter whether that instance is standalone or 
part of a multi-instance setup.

> If so, then your script will have to
> test both locations, anyway, because you'll have to check to see if the
> (optional) override file exists in CATALINA_BASE and then check for it
> again under CATALINA_HOME.
> 
> Having a blank CATALINA_BASE seems to be helpful in this situation.

Well, then there *is* reason to leave it as is. That is a helpful answer to my 
question.

> Is there a situation that you think doesn't work given the current
> script behavior?

No, and I didn't want to imply that. But in general, one can change something 
that already works to make it work a little bit better :-)

Thanks for your time.

Rainer

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

Reply via email to