You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/12/30 15:08:17 UTC

DO NOT REPLY [Bug 48464] New: Feature request: startup.bat: -title option needed

https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

           Summary: Feature request: startup.bat: -title option needed
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Native:Integration
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: lovetide@qq.com


Created an attachment (id=24780)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24780)
Patches for startup.bat(svn#562770), catelina.bat (svn#885002). Usage
screenshot

When running muitiple tomcat instances in same windows OS, the title of all
tomcat/DOS window are all "Tomcat", it's a little hard to distinguish which
window is which tomcat. 

If a title can be added, for example: 
bin\startup.bat -title "Tomcat Server 1 - XXX" 
bin\startup.bat -title "Tomcat Server 2 - YYY" 
bin\startup.bat -title "Tomcat Server 3 - ZZZ" 
... 

Then I can distinguish these servers from the title of tomcat/DOS window in
task bar.

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #4 from LiuYan <lo...@qq.com> 2009-12-31 05:23:57 UTC ---
(In reply to comment #3)
> Thanks for the updated patch. It is heading in the right direction but maybe I
> wasn't clean enough in my previous comments.
> I do not believe this should be configurable via a command line parameter for
> startup.bat nor catalina.bat. This should simply be a system property that can
> be set in setenv.bat if required.
> Take a look at catalina.bat and how, for example, how LOGGING_MANAGER is used.

Hi Mark:

Pass title via command line parameter is just a convenient usage.

If it's not prefered, then only apply the lastest patch for catalina.bat (if
it's acceptable) can works as what you mean in comment #1. In the latest patch
for catalina.bat, TITLE and STARTUP_TIME environment varaibles are readed and
passed to _EXECJAVA.



By the way:
If %CD% contains "&" character, the startup.bat will failed at
cd %CURRENT_DIR%

%CURRENT_DIR% need to be quoted to avoid this error. "cd %CURRENT_DIR%" exists
in startup.bat, shutdown.bat, catalina.bat, service.bat, version.bat, should I
post a new bug?

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

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

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

--- Comment #9 from LiuYan 刘研 <lo...@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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #8 from Konstantin Kolinko <kn...@gmail.com> 2010-01-03 06:57:53 UTC ---
Re Comment 4:
> If %CD% contains "&" character, the startup.bat will failed at
Fixed in trunk (r895191, r895392), proposed for TC 6.0

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #1 from Mark Thomas <ma...@apache.org> 2009-12-31 01:21:51 GMT ---
The preferred format for patches is diff -u

The screen shot is unnecessary and makes the attachment 50 times bigger than it
needs to be.

I am -1 for the patch as is since it makes Title a mandatory parameter for
catalina.bat. This would be an added nuisance for far more users that it would
benefit.

I'd suggest using an environment variable for the title that defaults to Tomcat

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

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

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

--- Comment #6 from LiuYan 刘研 <lo...@qq.com> 2010-01-02 23:27:06 UTC ---
Created an attachment (id=24788)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24788)
Patch for catalina.bat#885002 (renew#2), document added

Patch updated.
I documented these environment variables in this patch, hope there's no
chinglish in it:

TITLE           (Optional) Specify the title of Tomcat window. The default
                TITLE is Tomcat if it's not specified.
                Example (all one line)
                set TITLE=Tomcat Server 1

TITLE_WITH_TIME (Optional) If set, regardless the value of it, current
                datetime will be appended to title, so that you can know
                the startup time of Tomcat from title.
                Example (all one line)
                set TITLE_WITH_TIME=whatever non empty value

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #10 from Mark Thomas <ma...@apache.org> 2010-01-04 03:33:43 GMT ---
Patch looks good to me. I have applied it to trunk and proposed it for 6.0.x.

I have credited the patch to "LiuYan". If this is wrong, let me know the
correct name to use and I'll make the necessary changes.

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

LiuYan <lo...@qq.com> changed:

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

--- Comment #2 from LiuYan <lo...@qq.com> 2009-12-31 04:04:48 UTC ---
Created an attachment (id=24784)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24784)
Patches for startup.bat(svn#562770), catelina.bat(svn#885002)

-t, -title: specify a title
-tt, -timetitle: specify a title, and append current time to title

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #7 from Konstantin Kolinko <kn...@gmail.com> 2010-01-03 05:03:25 UTC ---
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.


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%

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.

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Mark Thomas <ma...@apache.org> 2010-01-13 02:43:42 GMT ---
The patch has been applied to 6.0.x and will be included in 6.0.23 onwards.

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #3 from Mark Thomas <ma...@apache.org> 2009-12-31 04:17:25 GMT ---
Thanks for the updated patch. It is heading in the right direction but maybe I
wasn't clean enough in my previous comments.

I do not believe this should be configurable via a command line parameter for
startup.bat nor catalina.bat. This should simply be a system property that can
be set in setenv.bat if required.

Take a look at catalina.bat and how, for example, how LOGGING_MANAGER is used.

-- 
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


DO NOT REPLY [Bug 48464] Feature request: startup.bat: -title option needed

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48464

--- Comment #5 from Mark Thomas <ma...@apache.org> 2009-12-31 05:27:50 GMT ---
(In reply to comment #4)
> If it's not prefered, then only apply the lastest patch for catalina.bat (if
> it's acceptable) can works as what you mean in comment #1. In the latest patch
> for catalina.bat, TITLE and STARTUP_TIME environment varaibles are readed and
> passed to _EXECJAVA.

The new environment variables still need to be documented in the same way as
the other environment variables.

> By the way:
> If %CD% contains "&" character, the startup.bat will failed at
> cd %CURRENT_DIR%
> 
> %CURRENT_DIR% need to be quoted to avoid this error. "cd %CURRENT_DIR%" exists
> in startup.bat, shutdown.bat, catalina.bat, service.bat, version.bat, should I
> post a new bug?

Yes please.

-- 
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