source: nutchez-0.1/tomcat/bin/catalina.bat @ 188

Last change on this file since 188 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

File size: 9.7 KB
RevLine 
[66]1@echo off
2rem Licensed to the Apache Software Foundation (ASF) under one or more
3rem contributor license agreements.  See the NOTICE file distributed with
4rem this work for additional information regarding copyright ownership.
5rem The ASF licenses this file to You under the Apache License, Version 2.0
6rem (the "License"); you may not use this file except in compliance with
7rem the License.  You may obtain a copy of the License at
8rem
9rem     http://www.apache.org/licenses/LICENSE-2.0
10rem
11rem Unless required by applicable law or agreed to in writing, software
12rem distributed under the License is distributed on an "AS IS" BASIS,
13rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14rem See the License for the specific language governing permissions and
15rem limitations under the License.
16
17if "%OS%" == "Windows_NT" setlocal
18rem ---------------------------------------------------------------------------
19rem Start/Stop Script for the CATALINA Server
20rem
21rem Environment Variable Prequisites
22rem
23rem   CATALINA_HOME   May point at your Catalina "build" directory.
24rem
25rem   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
26rem                   of a Catalina installation.  If not present, resolves to
27rem                   the same directory that CATALINA_HOME points to.
28rem
29rem   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
30rem                   or "run" command is executed.
31rem
32rem   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
33rem                   the JVM should use (java.io.tmpdir).  Defaults to
34rem                   %CATALINA_BASE%\temp.
35rem
36rem   JAVA_HOME       Must point at your Java Development Kit installation.
37rem                   Required to run the with the "debug" argument.
38rem
39rem   JRE_HOME        Must point at your Java Runtime installation.
40rem                   Defaults to JAVA_HOME if empty.
41rem
42rem   JAVA_OPTS       (Optional) Java runtime options used when the "start",
43rem                   "stop", or "run" command is executed.
44rem
45rem   JSSE_HOME       (Optional) May point at your Java Secure Sockets Extension
46rem                   (JSSE) installation, whose JAR files will be added to the
47rem                   system class path used to start Tomcat.
48rem
49rem   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
50rem                   command is executed. The default is "dt_shmem".
51rem
52rem   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
53rem                   command is executed. The default is "jdbconn".
54rem
55rem   JPDA_SUSPEND    (Optional) Java runtime options used when the "jpda start"
56rem                   command is executed. Specifies whether JVM should suspend
57rem                   execution immediately after startup. Default is "n".
58rem
59rem   JPDA_OPTS       (Optional) Java runtime options used when the "jpda start"
60rem                   command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
61rem                   and JPDA_SUSPEND are ignored. Thus, all required jpda
62rem                   options MUST be specified. The default is:
63rem
64rem                   -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,
65rem                       address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
66rem
67rem $Id: catalina.bat 656834 2008-05-15 21:04:04Z markt $
68rem ---------------------------------------------------------------------------
69
70rem Guess CATALINA_HOME if not defined
71set CURRENT_DIR=%cd%
72if not "%CATALINA_HOME%" == "" goto gotHome
73set CATALINA_HOME=%CURRENT_DIR%
74if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
75cd ..
76set CATALINA_HOME=%cd%
77cd %CURRENT_DIR%
78:gotHome
79if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
80echo The CATALINA_HOME environment variable is not defined correctly
81echo This environment variable is needed to run this program
82goto end
83:okHome
84
85rem Get standard environment variables
86if "%CATALINA_BASE%" == "" goto gotSetenvHome
87if exist "%CATALINA_BASE%\bin\setenv.bat" call "%CATALINA_BASE%\bin\setenv.bat"
88goto gotSetenvBase
89:gotSetenvHome
90if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
91:gotSetenvBase
92
93rem Get standard Java environment variables
94if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
95echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
96echo This file is needed to run this program
97goto end
98:okSetclasspath
99set BASEDIR=%CATALINA_HOME%
100call "%CATALINA_HOME%\bin\setclasspath.bat" %1
101if errorlevel 1 goto end
102
103rem Add on extra jar files to CLASSPATH
104if "%JSSE_HOME%" == "" goto noJsse
105set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
106:noJsse
107set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
108
109if not "%CATALINA_BASE%" == "" goto gotBase
110set CATALINA_BASE=%CATALINA_HOME%
111:gotBase
112
113if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
114set CATALINA_TMPDIR=%CATALINA_BASE%\temp
115:gotTmpdir
116
117if not exist "%CATALINA_BASE%\conf\logging.properties" goto noJuli
118set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
119:noJuli
120
121rem ----- Execute The Requested Command ---------------------------------------
122
123echo Using CATALINA_BASE:   %CATALINA_BASE%
124echo Using CATALINA_HOME:   %CATALINA_HOME%
125echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
126if ""%1"" == ""debug"" goto use_jdk
127echo Using JRE_HOME:        %JRE_HOME%
128goto java_dir_displayed
129:use_jdk
130echo Using JAVA_HOME:       %JAVA_HOME%
131:java_dir_displayed
132
133set _EXECJAVA=%_RUNJAVA%
134set MAINCLASS=org.apache.catalina.startup.Bootstrap
135set ACTION=start
136set SECURITY_POLICY_FILE=
137set DEBUG_OPTS=
138set JPDA=
139
140if not ""%1"" == ""jpda"" goto noJpda
141set JPDA=jpda
142if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
143set JPDA_TRANSPORT=dt_shmem
144:gotJpdaTransport
145if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
146set JPDA_ADDRESS=jdbconn
147:gotJpdaAddress
148if not "%JPDA_SUSPEND%" == "" goto gotJpdaSuspend
149set JPDA_SUSPEND=n
150:gotJpdaSuspend
151if not "%JPDA_OPTS%" == "" goto gotJpdaOpts
152set JPDA_OPTS=-agentlib:jdwp=transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
153:gotJpdaOpts
154shift
155:noJpda
156
157if ""%1"" == ""debug"" goto doDebug
158if ""%1"" == ""run"" goto doRun
159if ""%1"" == ""start"" goto doStart
160if ""%1"" == ""stop"" goto doStop
161if ""%1"" == ""version"" goto doVersion
162
163echo Usage:  catalina ( commands ... )
164echo commands:
165echo   debug             Start Catalina in a debugger
166echo   debug -security   Debug Catalina with a security manager
167echo   jpda start        Start Catalina under JPDA debugger
168echo   run               Start Catalina in the current window
169echo   run -security     Start in the current window with security manager
170echo   start             Start Catalina in a separate window
171echo   start -security   Start in a separate window with security manager
172echo   stop              Stop Catalina
173echo   version           What version of tomcat are you running?
174goto end
175
176:doDebug
177shift
178set _EXECJAVA=%_RUNJDB%
179set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\java"
180if not ""%1"" == ""-security"" goto execCmd
181shift
182echo Using Security Manager
183set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
184goto execCmd
185
186:doRun
187shift
188if not ""%1"" == ""-security"" goto execCmd
189shift
190echo Using Security Manager
191set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
192goto execCmd
193
194:doStart
195shift
196if not "%OS%" == "Windows_NT" goto noTitle
197set _EXECJAVA=start "Tomcat" %_RUNJAVA%
198goto gotTitle
199:noTitle
200set _EXECJAVA=start %_RUNJAVA%
201:gotTitle
202if not ""%1"" == ""-security"" goto execCmd
203shift
204echo Using Security Manager
205set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
206goto execCmd
207
208:doStop
209shift
210set ACTION=stop
211set CATALINA_OPTS=
212goto execCmd
213
214:doVersion
215%_EXECJAVA% -classpath "%CATALINA_HOME%\lib\catalina.jar" org.apache.catalina.util.ServerInfo
216goto end
217
218
219:execCmd
220rem Get remaining unshifted command line arguments and save them in the
221set CMD_LINE_ARGS=
222:setArgs
223if ""%1""=="""" goto doneSetArgs
224set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
225shift
226goto setArgs
227:doneSetArgs
228
229rem Execute Java with the applicable properties
230if not "%JPDA%" == "" goto doJpda
231if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
232%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
233goto end
234:doSecurity
235%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
236goto end
237:doJpda
238if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
239%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
240goto end
241:doSecurityJpda
242%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
243goto end
244
245:end
Note: See TracBrowser for help on using the repository browser.