tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed
Date Mon, 04 Jan 2010 03:00:14 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

LiuYan 刘研 <lovetide@qq.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #24788|0                           |1
        is obsolete|                            |

--- Comment #9 from LiuYan 刘研 <lovetide@qq.com> 2010-01-03 19:00:10 UTC ---
Created an attachment (id=24790)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24790)
Patch for catalina.bat#895517

(In reply to comment #7)
> Re startup.bat:
> Please note, that since TC 6.0.16/5.5.26 you can create
> %CATALINA_BASE%/bin/setenv.bat, and place your instance-specific variable
> assignments there.
> Also you can write your own simple script to process -t and -tt arguments, set
> the varables, and call startup.bat (or directly "catalina.bat start").
> Because the title can be set programmatically in those scripts, I see no point
> in providing the 'TITLE_WITH_TIME' variable.

Ok, I'll write my own batch script to process command line arguments.
And 'TITLE_WITH_TIME' is removed. This patch seems tidy now. :)

For one installation one instance situation, tomcat users can specify TITLE in
%CATALINA_BASE%/bin/setenv.bat.

For running multiple instances from one tomcat installation situation, tomcat
users need to write their own script to have different TITLEs. for example:

start_clustered_servers.cmd
-----------------
@echo off
set CATALINA_HOME=apache-tomcat-6.0.22

set CATALINA_BASE=server1_1
set TITLE=Tomcat.Cluster#1.Server#1 [%DATE% %TIME%]
call "%CATALINA_HOME%\bin\startup.bat"

set CATALINA_BASE=server1_2
set TITLE=Tomcat.Cluster#1.Server#2 [%DATE% %TIME%]
call "%CATALINA_HOME%\bin\startup.bat"

set CATALINA_BASE=server2_1
set TITLE=Tomcat.Cluster#2.Server#1 [%DATE% %TIME%]
call "%CATALINA_HOME%\bin\startup.bat"

REM ...
-----------------

> Re Comment 4:
> > If %CD% contains "&" character, the startup.bat will failed at
> > cd %CURRENT_DIR%
> > %CURRENT_DIR% need to be quoted to avoid this error.
> For me it fails a few lines earlier, when executing
> set CURRENT_DIR=%cd%

My mistake, The failed line is "set CURRENT_DIR=%cd%".

> The solution is to add quotes to the set command as well:
> set "CURRENT_DIR=%cd%"
> The above is on Windows XP.
> I will work on a patch, though will need to wait till the end of the holidays
> to test on the other Windows versions as well.

That's GREAT !!!
When I try to resolve this problem, I only know the usage of place double quote
around %CD% --> "%CD", I do not know the quote can include the variable name
⊙_⊙, so I encounted another problem when referencing
CURRENT_DIR/CATALINA_HOME/... with another double quotes around
("%CURRENT_DIR%" --> ""C:\Tomcat Cluster & LoadBalance Test"").

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message