Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
#!/bin/sh
2
export JAVA_HOME=/usr/java/jdk1.7.0_51/
3
export JRE_HOME=$JAVA_HOME
4
export CATALINA_HOME=/home/espacoc/appservers/apache-tomcat-7x/
5
export JAVA_OPTS="-Xmx512000000 -Djava.awt.headless=true -Duser.timezone=America/Maceio"
6
 
7
 
8
# Licensed to the Apache Software Foundation (ASF) under one or more
9
# contributor license agreements.  See the NOTICE file distributed with
10
# this work for additional information regarding copyright ownership.
11
# The ASF licenses this file to You under the Apache License, Version 2.0
12
# (the "License"); you may not use this file except in compliance with
13
# the License.  You may obtain a copy of the License at
14
#
15
#     http://www.apache.org/licenses/LICENSE-2.0
16
#
17
# Unless required by applicable law or agreed to in writing, software
18
# distributed under the License is distributed on an "AS IS" BASIS,
19
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
# See the License for the specific language governing permissions and
21
# limitations under the License.
22
 
23
# -----------------------------------------------------------------------------
24
# Control Script for the CATALINA Server
25
#
26
# Environment Variable Prerequisites
27
#
28
#   Do not set the variables in this script. Instead put them into a script
29
#   setenv.sh in CATALINA_BASE/bin to keep your customizations separate.
30
#
31
#   CATALINA_HOME   May point at your Catalina "build" directory.
32
#
33
#   CATALINA_BASE   (Optional) Base directory for resolving dynamic portions
34
#                   of a Catalina installation.  If not present, resolves to
35
#                   the same directory that CATALINA_HOME points to.
36
#
37
#   CATALINA_OUT    (Optional) Full path to a file where stdout and stderr
38
#                   will be redirected.
39
#                   Default is $CATALINA_BASE/logs/catalina.out
40
#
41
#   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
42
#                   "run" or "debug" command is executed.
43
#                   Include here and not in JAVA_OPTS all options, that should
44
#                   only be used by Tomcat itself, not by the stop process,
45
#                   the version command etc.
46
#                   Examples are heap size, GC logging, JMX ports etc.
47
#
48
#   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
49
#                   the JVM should use (java.io.tmpdir).  Defaults to
50
#                   $CATALINA_BASE/temp.
51
#
52
#   JAVA_HOME       Must point at your Java Development Kit installation.
53
#                   Required to run the with the "debug" argument.
54
#
55
#   JRE_HOME        Must point at your Java Runtime installation.
56
#                   Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
57
#                   are both set, JRE_HOME is used.
58
#
59
#   JAVA_OPTS       (Optional) Java runtime options used when any command
60
#                   is executed.
61
#                   Include here and not in CATALINA_OPTS all options, that
62
#                   should be used by Tomcat and also by the stop process,
63
#                   the version command etc.
64
#                   Most options should go into CATALINA_OPTS.
65
#
66
#   JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories
67
#                   containing some jars in order to allow replacement of APIs
68
#                   created outside of the JCP (i.e. DOM and SAX from W3C).
69
#                   It can also be used to update the XML parser implementation.
70
#                   Defaults to $CATALINA_HOME/endorsed.
71
#
72
#   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
73
#                   command is executed. The default is "dt_socket".
74
#
75
#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda start"
76
#                   command is executed. The default is 8000.
77
#
78
#   JPDA_SUSPEND    (Optional) Java runtime options used when the "jpda start"
79
#                   command is executed. Specifies whether JVM should suspend
80
#                   execution immediately after startup. Default is "n".
81
#
82
#   JPDA_OPTS       (Optional) Java runtime options used when the "jpda start"
83
#                   command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
84
#                   and JPDA_SUSPEND are ignored. Thus, all required jpda
85
#                   options MUST be specified. The default is:
86
#
87
#                   -agentlib:jdwp=transport=$JPDA_TRANSPORT,
88
#                       address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND
89
#
90
#   CATALINA_PID    (Optional) Path of the file which should contains the pid
91
#                   of the catalina startup java process, when start (fork) is
92
#                   used
93
#
94
#   LOGGING_CONFIG  (Optional) Override Tomcat's logging config file
95
#                   Example (all one line)
96
#                   LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
97
#
98
#   LOGGING_MANAGER (Optional) Override Tomcat's logging manager
99
#                   Example (all one line)
100
#                   LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
101
#
102
# $Id: catalina.sh 1202062 2011-11-15 06:50:02Z mturk $
103
# -----------------------------------------------------------------------------
104
 
105
# OS specific support.  $var _must_ be set to either true or false.
106
cygwin=false
107
darwin=false
108
os400=false
109
case "`uname`" in
110
CYGWIN*) cygwin=true;;
111
Darwin*) darwin=true;;
112
OS400*) os400=true;;
113
esac
114
 
115
# resolve links - $0 may be a softlink
116
PRG="$0"
117
 
118
while [ -h "$PRG" ]; do
119
  ls=`ls -ld "$PRG"`
120
  link=`expr "$ls" : '.*-> \(.*\)$'`
121
  if expr "$link" : '/.*' > /dev/null; then
122
    PRG="$link"
123
  else
124
    PRG=`dirname "$PRG"`/"$link"
125
  fi
126
done
127
 
128
# Get standard environment variables
129
PRGDIR=`dirname "$PRG"`
130
 
131
# Only set CATALINA_HOME if not already set
132
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
133
 
134
# Copy CATALINA_BASE from CATALINA_HOME if not already set
135
[ -z "$CATALINA_BASE" ] && CATALINA_BASE="$CATALINA_HOME"
136
 
137
# Ensure that any user defined CLASSPATH variables are not used on startup,
138
# but allow them to be specified in setenv.sh, in rare case when it is needed.
139
CLASSPATH=
140
 
141
if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
142
  . "$CATALINA_BASE/bin/setenv.sh"
143
elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
144
  . "$CATALINA_HOME/bin/setenv.sh"
145
fi
146
 
147
# For Cygwin, ensure paths are in UNIX format before anything is touched
148
if $cygwin; then
149
  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
150
  [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
151
  [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
152
  [ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"`
153
  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
154
fi
155
 
156
# For OS400
157
if $os400; then
158
  # Set job priority to standard for interactive (interactive - 6) by using
159
  # the interactive priority - 6, the helper threads that respond to requests
160
  # will be running at the same priority as interactive jobs.
161
  COMMAND='chgjob job('$JOBNAME') runpty(6)'
162
  system $COMMAND
163
 
164
  # Enable multi threading
165
  export QIBM_MULTI_THREADED=Y
166
fi
167
 
168
# Get standard Java environment variables
169
if $os400; then
170
  # -r will Only work on the os400 if the files are:
171
  # 1. owned by the user
172
  # 2. owned by the PRIMARY group of the user
173
  # this will not work if the user belongs in secondary groups
174
  . "$CATALINA_HOME"/bin/setclasspath.sh
175
else
176
  if [ -r "$CATALINA_HOME"/bin/setclasspath.sh ]; then
177
    . "$CATALINA_HOME"/bin/setclasspath.sh
178
  else
179
    echo "Cannot find $CATALINA_HOME/bin/setclasspath.sh"
180
    echo "This file is needed to run this program"
181
    exit 1
182
  fi
183
fi
184
 
185
# Add on extra jar files to CLASSPATH
186
if [ ! -z "$CLASSPATH" ] ; then
187
  CLASSPATH="$CLASSPATH":
188
fi
189
CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar
190
 
191
if [ -z "$CATALINA_OUT" ] ; then
192
  CATALINA_OUT=/home/espacoc/appservers/apache-tomcat-7x/logs/stdout.log
193
fi
194
 
195
if [ -z "$CATALINA_TMPDIR" ] ; then
196
  # Define the java.io.tmpdir to use for Catalina
197
  CATALINA_TMPDIR="$CATALINA_BASE"/temp
198
fi
199
 
200
# Add tomcat-juli.jar to classpath
201
# tomcat-juli.jar can be over-ridden per instance
202
if [ -r "$CATALINA_BASE/bin/tomcat-juli.jar" ] ; then
203
  CLASSPATH=$CLASSPATH:$CATALINA_BASE/bin/tomcat-juli.jar
204
else
205
  CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/tomcat-juli.jar
206
fi
207
 
208
# Bugzilla 37848: When no TTY is available, don't output to console
209
have_tty=0
210
if [ "`tty`" != "not a tty" ]; then
211
    have_tty=1
212
fi
213
 
214
# For Cygwin, switch paths to Windows format before running java
215
if $cygwin; then
216
  JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
217
  JRE_HOME=`cygpath --absolute --windows "$JRE_HOME"`
218
  CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"`
219
  CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"`
220
  CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"`
221
  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
222
  JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`
223
fi
224
 
225
# Set juli LogManager config file if it is present and an override has not been issued
226
if [ -z "$LOGGING_CONFIG" ]; then
227
  if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
228
    LOGGING_CONFIG="-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties"
229
  else
230
    # Bugzilla 45585
231
    LOGGING_CONFIG="-Dnop"
232
  fi
233
fi
234
 
235
if [ -z "$LOGGING_MANAGER" ]; then
236
  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
237
else
238
  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
239
fi
240
 
241
# Uncomment the following line to make the umask available when using the
242
# org.apache.catalina.security.SecurityListener
243
#JAVA_OPTS="$JAVA_OPTS -Dorg.apache.catalina.security.SecurityListener.UMASK=`umask`"
244
 
245
# ----- Execute The Requested Command -----------------------------------------
246
 
247
# Bugzilla 37848: only output this if we have a TTY
248
if [ $have_tty -eq 1 ]; then
249
  echo "Using CATALINA_BASE:   $CATALINA_BASE"
250
  echo "Using CATALINA_HOME:   $CATALINA_HOME"
251
  echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
252
  if [ "$1" = "debug" ] ; then
253
    echo "Using JAVA_HOME:       $JAVA_HOME"
254
  else
255
    echo "Using JRE_HOME:        $JRE_HOME"
256
  fi
257
  echo "Using CLASSPATH:       $CLASSPATH"
258
  if [ ! -z "$CATALINA_PID" ]; then
259
    echo "Using CATALINA_PID:    $CATALINA_PID"
260
  fi
261
fi
262
 
263
if [ "$1" = "jpda" ] ; then
264
  if [ -z "$JPDA_TRANSPORT" ]; then
265
    JPDA_TRANSPORT="dt_socket"
266
  fi
267
  if [ -z "$JPDA_ADDRESS" ]; then
268
    JPDA_ADDRESS="8000"
269
  fi
270
  if [ -z "$JPDA_SUSPEND" ]; then
271
    JPDA_SUSPEND="n"
272
  fi
273
  if [ -z "$JPDA_OPTS" ]; then
274
    JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
275
  fi
276
  CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
277
  shift
278
fi
279
 
280
if [ "$1" = "debug" ] ; then
281
  if $os400; then
282
    echo "Debug command not available on OS400"
283
    exit 1
284
  else
285
    shift
286
    if [ "$1" = "-security" ] ; then
287
      if [ $have_tty -eq 1 ]; then
288
        echo "Using Security Manager"
289
      fi
290
      shift
291
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
292
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
293
        -sourcepath "$CATALINA_HOME"/../../java \
294
        -Djava.security.manager \
295
        -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
296
        -Dcatalina.base="$CATALINA_BASE" \
297
        -Dcatalina.home="$CATALINA_HOME" \
298
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
299
        org.apache.catalina.startup.Bootstrap "$@" start
300
    else
301
      exec "$_RUNJDB" "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \
302
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
303
        -sourcepath "$CATALINA_HOME"/../../java \
304
        -Dcatalina.base="$CATALINA_BASE" \
305
        -Dcatalina.home="$CATALINA_HOME" \
306
        -Djava.io.tmpdir="$CATALINA_TMPDIR" \
307
        org.apache.catalina.startup.Bootstrap "$@" start
308
    fi
309
  fi
310
 
311
elif [ "$1" = "run" ]; then
312
 
313
  shift
314
  if [ "$1" = "-security" ] ; then
315
    if [ $have_tty -eq 1 ]; then
316
      echo "Using Security Manager"
317
    fi
318
    shift
319
    eval exec \"$_RUNJAVA\" \"$LOGGING_CONFIG\" $JAVA_OPTS $CATALINA_OPTS \
320
      -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
321
      -Djava.security.manager \
322
      -Djava.security.policy==\"$CATALINA_BASE/conf/catalina.policy\" \
323
      -Dcatalina.base=\"$CATALINA_BASE\" \
324
      -Dcatalina.home=\"$CATALINA_HOME\" \
325
      -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
326
      org.apache.catalina.startup.Bootstrap "$@" start
327
  else
328
    eval exec \"$_RUNJAVA\" \"$LOGGING_CONFIG\" $JAVA_OPTS $CATALINA_OPTS \
329
      -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
330
      -Dcatalina.base=\"$CATALINA_BASE\" \
331
      -Dcatalina.home=\"$CATALINA_HOME\" \
332
      -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
333
      org.apache.catalina.startup.Bootstrap "$@" start
334
  fi
335
 
336
elif [ "$1" = "start" ] ; then
337
 
338
  if [ ! -z "$CATALINA_PID" ]; then
339
    if [ -f "$CATALINA_PID" ]; then
340
      if [ -s "$CATALINA_PID" ]; then
341
        echo "Existing PID file found during start."
342
        if [ -r "$CATALINA_PID" ]; then
343
          PID=`cat "$CATALINA_PID"`
344
          ps -p $PID >/dev/null 2>&1
345
          if [ $? -eq 0 ] ; then
346
            echo "Tomcat appears to still be running with PID $PID. Start aborted."
347
            exit 1
348
          else
349
            echo "Removing/clearing stale PID file."
350
            rm -f "$CATALINA_PID" >/dev/null 2>&1
351
            if [ $? != 0 ]; then
352
              if [ -w "$CATALINA_PID" ]; then
353
                cat /dev/null > "$CATALINA_PID"
354
              else
355
                echo "Unable to remove or clear stale PID file. Start aborted."
356
                exit 1
357
              fi
358
            fi
359
          fi
360
        else
361
          echo "Unable to read PID file. Start aborted."
362
          exit 1
363
        fi
364
      else
365
        rm -f "$CATALINA_PID" >/dev/null 2>&1
366
        if [ $? != 0 ]; then
367
          if [ ! -w "$CATALINA_PID" ]; then
368
            echo "Unable to remove or write to empty PID file. Start aborted."
369
            exit 1
370
          fi
371
        fi
372
      fi
373
    fi
374
  fi
375
 
376
  shift
377
  touch "$CATALINA_OUT"
378
  if [ "$1" = "-security" ] ; then
379
    if [ $have_tty -eq 1 ]; then
380
      echo "Using Security Manager"
381
    fi
382
    shift
383
    eval \"$_RUNJAVA\" \"$LOGGING_CONFIG\" $JAVA_OPTS $CATALINA_OPTS \
384
      -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
385
      -Djava.security.manager \
386
      -Djava.security.policy==\"$CATALINA_BASE/conf/catalina.policy\" \
387
      -Dcatalina.base=\"$CATALINA_BASE\" \
388
      -Dcatalina.home=\"$CATALINA_HOME\" \
389
      -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
390
      org.apache.catalina.startup.Bootstrap "$@" start \
391
      >> "$CATALINA_OUT" 2>&1 "&"
392
 
393
  else
394
    eval \"$_RUNJAVA\" \"$LOGGING_CONFIG\" $JAVA_OPTS $CATALINA_OPTS \
395
      -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
396
      -Dcatalina.base=\"$CATALINA_BASE\" \
397
      -Dcatalina.home=\"$CATALINA_HOME\" \
398
      -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
399
      org.apache.catalina.startup.Bootstrap "$@" start \
400
      >> "$CATALINA_OUT" 2>&1 "&"
401
 
402
  fi
403
 
404
  if [ ! -z "$CATALINA_PID" ]; then
405
    echo $! > "$CATALINA_PID"
406
  fi
407
 
408
elif [ "$1" = "stop" ] ; then
409
 
410
  shift
411
 
412
  SLEEP=5
413
  if [ ! -z "$1" ]; then
414
    echo $1 | grep "[^0-9]" >/dev/null 2>&1
415
    if [ $? -gt 0 ]; then
416
      SLEEP=$1
417
      shift
418
    fi
419
  fi
420
 
421
  FORCE=0
422
  if [ "$1" = "-force" ]; then
423
    shift
424
    FORCE=1
425
  fi
426
 
427
  if [ ! -z "$CATALINA_PID" ]; then
428
    if [ -f "$CATALINA_PID" ]; then
429
      if [ -s "$CATALINA_PID" ]; then
430
        kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1
431
        if [ $? -gt 0 ]; then
432
          echo "PID file found but no matching process was found. Stop aborted."
433
          exit 1
434
        fi
435
      else
436
        echo "PID file is empty and has been ignored."
437
      fi
438
    else
439
      echo "\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted."
440
      exit 1
441
    fi
442
  fi
443
 
444
  eval \"$_RUNJAVA\" $JAVA_OPTS \
445
    -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
446
    -Dcatalina.base=\"$CATALINA_BASE\" \
447
    -Dcatalina.home=\"$CATALINA_HOME\" \
448
    -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
449
    org.apache.catalina.startup.Bootstrap "$@" stop
450
 
451
  if [ ! -z "$CATALINA_PID" ]; then
452
    if [ -f "$CATALINA_PID" ]; then
453
      while [ $SLEEP -ge 0 ]; do
454
        kill -0 `cat "$CATALINA_PID"` >/dev/null 2>&1
455
        if [ $? -gt 0 ]; then
456
          rm -f "$CATALINA_PID" >/dev/null 2>&1
457
          if [ $? != 0 ]; then
458
            if [ -w "$CATALINA_PID" ]; then
459
              cat /dev/null > "$CATALINA_PID"
460
            else
461
              echo "Tomcat stopped but the PID file could not be removed or cleared."
462
            fi
463
          fi
464
          break
465
        fi
466
        if [ $SLEEP -gt 0 ]; then
467
          sleep 1
468
        fi
469
        if [ $SLEEP -eq 0 ]; then
470
          if [ $FORCE -eq 0 ]; then
471
            echo "Tomcat did not stop in time. PID file was not removed."
472
          fi
473
        fi
474
        SLEEP=`expr $SLEEP - 1 `
475
      done
476
    fi
477
  fi
478
 
479
  if [ $FORCE -eq 1 ]; then
480
    if [ -z "$CATALINA_PID" ]; then
481
      echo "Kill failed: \$CATALINA_PID not set"
482
    else
483
      if [ -f "$CATALINA_PID" ]; then
484
        PID=`cat "$CATALINA_PID"`
485
        echo "Killing Tomcat with the PID: $PID"
486
        kill -9 $PID
487
        rm -f "$CATALINA_PID" >/dev/null 2>&1
488
        if [ $? != 0 ]; then
489
          echo "Tomcat was killed but the PID file could not be removed."
490
        fi
491
      fi
492
    fi
493
  fi
494
 
495
elif [ "$1" = "configtest" ] ; then
496
 
497
    eval \"$_RUNJAVA\" $JAVA_OPTS \
498
      -Djava.endorsed.dirs=\"$JAVA_ENDORSED_DIRS\" -classpath \"$CLASSPATH\" \
499
      -Dcatalina.base=\"$CATALINA_BASE\" \
500
      -Dcatalina.home=\"$CATALINA_HOME\" \
501
      -Djava.io.tmpdir=\"$CATALINA_TMPDIR\" \
502
      org.apache.catalina.startup.Bootstrap configtest
503
    result=$?
504
    if [ $result -ne 0 ]; then
505
        echo "Configuration error detected!"
506
    fi
507
    exit $result
508
 
509
elif [ "$1" = "version" ] ; then
510
 
511
    "$_RUNJAVA"   \
512
      -classpath "$CATALINA_HOME/lib/catalina.jar" \
513
      org.apache.catalina.util.ServerInfo
514
 
515
else
516
 
517
  echo "Usage: catalina.sh ( commands ... )"
518
  echo "commands:"
519
  if $os400; then
520
    echo "  debug             Start Catalina in a debugger (not available on OS400)"
521
    echo "  debug -security   Debug Catalina with a security manager (not available on OS400)"
522
  else
523
    echo "  debug             Start Catalina in a debugger"
524
    echo "  debug -security   Debug Catalina with a security manager"
525
  fi
526
  echo "  jpda start        Start Catalina under JPDA debugger"
527
  echo "  run               Start Catalina in the current window"
528
  echo "  run -security     Start in the current window with security manager"
529
  echo "  start             Start Catalina in a separate window"
530
  echo "  start -security   Start in a separate window with security manager"
531
  echo "  stop              Stop Catalina, waiting up to 5 seconds for the process to end"
532
  echo "  stop n            Stop Catalina, waiting up to n seconds for the process to end"
533
  echo "  stop -force       Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running"
534
  echo "  stop n -force     Stop Catalina, wait up to n seconds and then use kill -KILL if still running"
535
  echo "  configtest        Run a basic syntax check on server.xml - check exit code for result"
536
  echo "  version           What version of tomcat are you running?"
537
  echo "Note: Waiting for the process to end and use of the -force option require that \$CATALINA_PID is defined"
538
  exit 1
539
 
540
fi