Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 25008 invoked from network); 13 Nov 2004 18:57:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Nov 2004 18:57:35 -0000 Received: (qmail 19092 invoked by uid 500); 13 Nov 2004 18:57:28 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 18918 invoked by uid 500); 13 Nov 2004 18:57:27 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 18903 invoked by uid 500); 13 Nov 2004 18:57:27 -0000 Received: (qmail 18900 invoked by uid 99); 13 Nov 2004 18:57:27 -0000 X-ASF-Spam-Status: No, hits=-9.9 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 13 Nov 2004 10:57:26 -0800 Received: (qmail 24962 invoked by uid 1526); 13 Nov 2004 18:57:25 -0000 Date: 13 Nov 2004 18:57:25 -0000 Message-ID: <20041113185725.24961.qmail@minotaur.apache.org> From: mturk@apache.org To: jakarta-tomcat-catalina-cvs@apache.org Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/bin service.bat X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mturk 2004/11/13 10:57:25 Modified: catalina/src/bin service.bat Log: Use auto option for StdError and StdOutput. Revision Changes Path 1.10 +111 -109 jakarta-tomcat-catalina/catalina/src/bin/service.bat Index: service.bat =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/bin/service.bat,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- service.bat 5 Sep 2004 07:19:59 -0000 1.9 +++ service.bat 13 Nov 2004 18:57:25 -0000 1.10 @@ -1,109 +1,111 @@ -@echo off -if "%OS%" == "Windows_NT" setlocal -rem --------------------------------------------------------------------------- -rem NT Service Install/Uninstall script -rem -rem Options -rem install Install the service using Tomcat5 as service name. -rem Service is installed using default settings. -rem remove Remove the service from the System. -rem -rem name (optional) If the second argument is present it is considered -rem to be new service name -rem -rem $Id$ -rem --------------------------------------------------------------------------- - -rem Guess CATALINA_HOME if not defined -set CURRENT_DIR=%cd% -if not "%CATALINA_HOME%" == "" goto gotHome -set CATALINA_HOME=%cd% -if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome -rem CD to the upper dir -cd .. -set CATALINA_HOME=%cd% -:gotHome -if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome -echo The tomcat.exe was not found... -echo The CATALINA_HOME environment variable is not defined correctly. -echo This environment variable is needed to run this program -goto end -rem Make sure prerequisite environment variables are set -if not "%JAVA_HOME%" == "" goto okHome -echo The JAVA_HOME environment variable is not defined -echo This environment variable is needed to run this program -goto end -:okHome -if not "%CATALINA_BASE%" == "" goto gotBase -set CATALINA_BASE=%CATALINA_HOME% -:gotBase - -set EXECUTABLE=%CATALINA_HOME%\bin\tomcat5.exe - -rem Set default Service name -set SERVICE_NAME=Tomcat5 -set PR_DISPLAYNAME=Apache Tomcat - -if "%1" == "" goto displayUsage -if "%2" == "" goto setServiceName -set SERVICE_NAME=%2 -set PR_DISPLAYNAME=Apache Tomcat %2 -:setServiceName -if %1 == install goto doInstall -if %1 == remove goto doRemove -echo Unknown parameter "%1" -:displayUsage -echo -echo Usage: service.bat install/remove [service_name] -goto end - -:doRemove -rem Remove the service -"%EXECUTABLE%" //DS//%SERVICE_NAME% -echo The service '%SERVICE_NAME%' has been removed -goto end - -:doInstall -rem Install the service -echo Installing the service '%SERVICE_NAME%' ... -echo Using CATALINA_HOME: %CATALINA_HOME% -echo Using JAVA_HOME: %JAVA_HOME% - -rem Use the environment variables as an exaple -rem Each command line option is prefixed with PR_ - -set PR_DESCRIPTION=Apache Tomcat Server - http://jakarta.apache.org/tomcat -set PR_INSTALL=%EXECUTABLE% -set PR_LOGPATH=%CATALINA_HOME%\logs -set PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar -rem Set the server jvm from JAVA_HOME -set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll -if exist "%PR_JVM%" goto foundJvm -rem Set the client jvm from JAVA_HOME -set PR_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll -if exist "%PR_JVM%" goto foundJvm -set PR_JVM=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 -if not errorlevel 1 goto installed -echo Failed installing '%SERVICE_NAME%' service -goto end -:installed -rem Clear the environment variables. They are not needed any more. -set PR_DISPLAYNAME= -set PR_DESCRIPTION= -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%\common\endorsed" --StartMode jvm --StopMode jvm -rem More extra parameters -set PR_STDOUTPUT=%CATALINA_HOME%\logs\stdout.log -set PR_STDERROR=%CATALINA_HOME%\logs\stderr.log -"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx 256 -echo The service '%SERVICE_NAME%' has been installed. - -:end -cd %CURRENT_DIR% +@echo off +if "%OS%" == "Windows_NT" setlocal +rem --------------------------------------------------------------------------- +rem NT Service Install/Uninstall script +rem +rem Options +rem install Install the service using Tomcat5 as service name. +rem Service is installed using default settings. +rem remove Remove the service from the System. +rem +rem name (optional) If the second argument is present it is considered +rem to be new service name +rem +rem $Id$ +rem --------------------------------------------------------------------------- + +rem Guess CATALINA_HOME if not defined +set CURRENT_DIR=%cd% +if not "%CATALINA_HOME%" == "" goto gotHome +set CATALINA_HOME=%cd% +if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome +rem CD to the upper dir +cd .. +set CATALINA_HOME=%cd% +:gotHome +if exist "%CATALINA_HOME%\bin\tomcat5.exe" goto okHome +echo The tomcat.exe was not found... +echo The CATALINA_HOME environment variable is not defined correctly. +echo This environment variable is needed to run this program +goto end +rem Make sure prerequisite environment variables are set +if not "%JAVA_HOME%" == "" goto okHome +echo The JAVA_HOME environment variable is not defined +echo This environment variable is needed to run this program +goto end +:okHome +if not "%CATALINA_BASE%" == "" goto gotBase +set CATALINA_BASE=%CATALINA_HOME% +:gotBase + +set EXECUTABLE=%CATALINA_HOME%\bin\tomcat5.exe + +rem Set default Service name +set SERVICE_NAME=Tomcat5 +set PR_DISPLAYNAME=Apache Tomcat + +if "%1" == "" goto displayUsage +if "%2" == "" goto setServiceName +set SERVICE_NAME=%2 +set PR_DISPLAYNAME=Apache Tomcat %2 +:setServiceName +if %1 == install goto doInstall +if %1 == remove goto doRemove +if %1 == uninstall goto doRemove +echo Unknown parameter "%1" +:displayUsage +echo +echo Usage: service.bat install/remove [service_name] +goto end + +:doRemove +rem Remove the service +"%EXECUTABLE%" //DS//%SERVICE_NAME% +echo The service '%SERVICE_NAME%' has been removed +goto end + +:doInstall +rem Install the service +echo Installing the service '%SERVICE_NAME%' ... +echo Using CATALINA_HOME: %CATALINA_HOME% +echo Using JAVA_HOME: %JAVA_HOME% + +rem Use the environment variables as an exaple +rem Each command line option is prefixed with PR_ + +set PR_DESCRIPTION=Apache Tomcat Server - http://jakarta.apache.org/tomcat +set PR_INSTALL=%EXECUTABLE% +set PR_LOGPATH=%CATALINA_HOME%\logs +set PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar +rem Set the server jvm from JAVA_HOME +set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll +if exist "%PR_JVM%" goto foundJvm +rem Set the client jvm from JAVA_HOME +set PR_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll +if exist "%PR_JVM%" goto foundJvm +set PR_JVM=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 +if not errorlevel 1 goto installed +echo Failed installing '%SERVICE_NAME%' service +goto end +:installed +rem Clear the environment variables. They are not needed any more. +set PR_DISPLAYNAME= +set PR_DESCRIPTION= +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%\common\endorsed" --StartMode jvm --StopMode jvm +rem More extra parameters +set PR_LOGPATH=%CATALINA_HOME%\logs +set PR_STDOUTPUT=auto +set PR_STDERROR=auto +"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx 256 +echo The service '%SERVICE_NAME%' has been installed. + +:end +cd %CURRENT_DIR% --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org