tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1567742 - /tomcat/tc7.0.x/trunk/bin/service.bat
Date Sat, 15 Feb 2014 17:49:57 GMT
2014-02-12 23:50 GMT+04:00  <markt@apache.org>:
> Author: markt
> Date: Wed Feb 12 19:50:29 2014
> New Revision: 1567742
>
> URL: http://svn.apache.org/r1567742
> Log:
> Fix a secondary issue identified in https://issues.apache.org/bugzilla/show_bug.cgi?id=56079
> Install the service with a single call to the .exe rather than three calls.
>

Major:
---------
service.bat install  is broken by this change on Windows 7.

The symptom is that none of "PR_" variables set to pass classpath, jvm
etc. to  Tomcat7.exe
appear to have any effect.

It is odd. I suspect that it might be a bug in commons daemon procrun.

Does "install" command (//IS) in procrun recognize the environment variables?

A workaround should be to pass those values as arguments instead of
environment variables.

Documentation:
http://commons.apache.org/proper/commons-daemon/procrun.html

Steps to reproduce
--------------------------
With 7.0.52, on Windows 7

1. Set JAVA_HOME  (I was using 7u51 JDK)

2. Remove installed service, if any
service.bat remove
An UAC prompt appears, reply OK.

3. Install
service.bat install
An UAC prompt appears, reply OK.

4. Run tomcat7w.exe
An UAC prompt appears, reply OK.

Switch to "Java" page.
Actual:  Java Classpath field is empty
Expected: Java Classpath field has bootstrap.jar etc.

As a result, the service cannot be started.
("Start" command succeeds, but JVM exits immediately).

Minor:
---------
1) There is no changelog entry for this in Tomcat 7. (There is one in 8.0.4).

2) The following lines:

> +set PR_STDOUTPUT=auto
> +set PR_STDERROR=auto

They have no effect, because execution jumps around because of "goto foundJvm"

3) The "Clear the environment variables." part
is not executed on failure and does not clear PR_STDOUTPUT,
PR_STDERROR variables.

Actually, it is not needed at all and can be removed,  thanks to
"setlocal" call earlier.
It was needed earlier when Tomcat7.exe was called several times in
succession with different sets of variables.

Best regards,
Konstantin Kolinko

> Modified:
>     tomcat/tc7.0.x/trunk/bin/service.bat
>
> Modified: tomcat/tc7.0.x/trunk/bin/service.bat
> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/bin/service.bat?rev=1567742&r1=1567741&r2=1567742&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/bin/service.bat (original)
> +++ tomcat/tc7.0.x/trunk/bin/service.bat Wed Feb 12 19:50:29 2014
> @@ -137,9 +137,20 @@ rem Set the client jvm from JAVA_HOME
>  set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
>  if exist "%PR_JVM%" goto foundJvm
>  set PR_JVM=auto
> +set PR_STDOUTPUT=auto
> +set PR_STDERROR=auto
>  :foundJvm
>  echo Using JVM:              "%PR_JVM%"
> -"%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.catalina.startup.Bootstrap
--StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
> +"%EXECUTABLE%" //IS//%SERVICE_NAME% ^
> +    --StartClass org.apache.catalina.startup.Bootstrap ^
> +    --StopClass org.apache.catalina.startup.Bootstrap ^
> +    --StartParams start ^
> +    --StopParams stop ^
> +    --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties"
^
> +    --StartMode jvm ^
> +    --StopMode jvm ^
> +    --JvmMs 128 ^
> +    --JvmMx 256
>  if not errorlevel 1 goto installed
>  echo Failed installing '%SERVICE_NAME%' service
>  goto end
> @@ -151,13 +162,6 @@ set PR_INSTALL=
>  set PR_LOGPATH=
>  set PR_CLASSPATH=
>  set PR_JVM=
> -rem Set extra parameters
> -"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed"
--StartMode jvm --StopMode jvm
> -rem More extra parameters
> -set "PR_LOGPATH=%CATALINA_BASE%\logs"
> -set PR_STDOUTPUT=auto
> -set PR_STDERROR=auto
> -"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties"
--JvmMs 128 --JvmMx 256
>  echo The service '%SERVICE_NAME%' has been installed.
>
>  :end
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>

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


Mime
View raw message