geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <kevan.mil...@gmail.com>
Subject Re: svn commit: r355034 - in /geronimo/trunk/modules/scripts/src/resources/bin: geronimo.bat geronimo.sh setjavaenv.bat setjavaenv.sh
Date Thu, 08 Dec 2005 16:42:10 GMT
Hey John,
Unless my svn has gotten confused, these all got added as DOS files. Fixing
up CR/LF's in the build should fix the problem (I assume), but we should
probably update in svn, also... Not sure how to change this is svn...

MAC OS X isn't liking the DOS formatted  shell scripts...

kevan$ ./startup.sh
: bad interpreter: No such file or directory

--kevan

On 12/8/05, jsisson@apache.org <jsisson@apache.org> wrote:
>
> Author: jsisson
> Date: Thu Dec  8 00:14:08 2005
> New Revision: 355034
>
> URL: http://svn.apache.org/viewcvs?rev=355034&view=rev
> Log:
> GERONIMO-1166 (part 2) Provide Tomcat like startup and shutdown scripts
> (see mail thread
> http://www.mail-archive.com/dev@geronimo.apache.org/msg12524.html ).  The
> new scripts also allow Geronimo to be launched in the background.
> You can either use the geronimo.sh/bat script (most friendly for new
> users) or can call the startup.sh/bat or shutdown.sh/bat scripts directly
> (just like Tomcat).
>
> Added:
>     geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat   (with
> props)
>     geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh   (with
> props)
>     geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat
> (with props)
>     geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh   (with
> props)
>
> Added: geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat
> URL:
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat?rev=355034&view=auto
>
> ==============================================================================
> --- geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat (added)
> +++ geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat Thu
> Dec  8 00:14:08 2005
> @@ -0,0 +1,266 @@
> +@REM
> +@REM  Copyright 2005 The Apache Software Foundation
> +@REM
> +@REM   Licensed under the Apache License, Version 2.0 (the "License");
> +@REM   you may not use this file except in compliance with the License.
> +@REM   You may obtain a copy of the License at
> +@REM
> +@REM      http://www.apache.org/licenses/LICENSE-2.0
> +@REM
> +@REM   Unless required by applicable law or agreed to in writing,
> software
> +@REM   distributed under the License is distributed on an "AS IS" BASIS,
> +@REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +@REM   See the License for the specific language governing permissions
> and
> +@REM   limitations under the License.
> +
> +@REM --------------------------------------------------------------------
> +@REM $Rev$ $Date$
> +@REM --------------------------------------------------------------------
> +
> +@REM
> ---------------------------------------------------------------------------
> +@REM Start/Stop Batch file for Geronimo
> +@REM
> +@REM For usage information, just run geronimo.bat without any arguments.
> +@REM
> +@REM This script is based upon Tomcat's catalina.sh file to enable
> +@REM those familiar with Tomcat to quickly get started with Geronimo.
> +@REM
> +@REM Environment Variable Prequisites
> +@REM
> +@REM   GERONIMO_HOME   May point at your Geronimo top-level directory.
> +@REM                   If not specified, this batch file will attempt to
> +@REM                   discover it relative to the location of this file.
> +@REM
> +@REM   GERONIMO_BASE   (Optional) Base directory for resolving dynamic
> portions
> +@REM                   of a Geronimo installation.  If not present,
> resolves to
> +@REM                   the same directory that GERONIMO_HOME points to.
> +@REM
> +@REM   GERONIMO_OPTS   (Optional) Java runtime options (in addition to
> +@REM                   those set in JAVA_OPTS) used when the "start",
> +@REM                   "stop", or "run" command is executed.
> +@REM
> +@REM   GERONIMO_TMPDIR (Optional) Directory path location of temporary
> directory
> +@REM                   the JVM should use (java.io.tmpdir).  Defaults to
> +@REM                   %GERONIMO_BASE%\var\temp.
> +@REM
> +@REM   JAVA_HOME       Points to your Java Development Kit installation.
> +@REM                   JAVA_HOME doesn't need to be set if JRE_HOME is
> set
> +@REM                   unless you use the "debug" command.
> +@REM                   It is mandatory either JAVA_HOME or JRE_HOME are
> set.
> +@REM
> +@REM   JRE_HOME        (Optional) Points to your Java Runtime Environment
> +@REM                   Set this if you wish to run Geronimo using the JRE
> +@REM                   instead of the JDK (except for the "debug"
> command).
> +@REM                   Defaults to JAVA_HOME if empty.
> +@REM                   It is mandatory either JAVA_HOME or JRE_HOME are
> set.
> +@REM
> +@REM   JAVA_OPTS       (Optional) Java runtime options used when the
> "start",
> +@REM                   "stop", or "run" command is executed.
> +@REM                   Also see the GERONIMO_OPTS environment variable.
> +@REM
> +@REM   JDB_SRCPATH     (Optional) The Source Path to be used by jdb
> debugger.
> +@REM                   Defaults to %GERONIMO_HOME%\src
> +@REM
> +@REM   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda
> start"
> +@REM                   command is executed. The default is "dt_shmem".
> +@REM
> +@REM   JPDA_ADDRESS    (Optional) Java runtime options used when the
> "jpda start"
> +@REM                   command is executed. The default is "jdbconn".
> +@REM
> +@REM Troubleshooting execution of this batch file:
> +@REM
> +@REM   GERONIMO_BATCH_ECHO (Optional) Environment variable that when set
> to
> +@REM                       "on" results in batch commands being echoed.
> +@REM
> +@REM   GERONIMO_BATCH_PAUSE (Optional) Environment variable that when set
> to
> +@REM                        "on" results in each batch file to pause at
> the
> +@REM                        end of execution
> +@REM
> +@REM Batch files called by this batch file:
> +@REM
> +@REM   %GERONIMO_HOME%\bin\setenv.bat
> +@REM                   (Optional) This batch file is called if it is
> present.
> +@REM                   Its contents may set one or more of the above
> environment
> +@REM                   variables.
> +@REM
> +@REM   %GERONIMO_HOME%\bin\setjavaenv.bat
> +@REM                   This batch file is called to set environment
> variables
> +@REM                   relating to the java or jdb exe file to call.
> +@REM                   This file should not need to be modified.
> +@REM
> +@REM Exit Codes:
> +@REM
> +@REM  0 - Success
> +@REM  1 - Error
> +@REM
> ---------------------------------------------------------------------------
> +
> +@if "%GERONIMO_BATCH_ECHO%" == "on"  echo on
> +@if not "%GERONIMO_BATCH_ECHO%" == "on"  echo off
> +
> +if "%OS%" == "Windows_NT" goto okOsCheck
> +echo Cannot process Geronimo command - you are running an unsupported
> operating system.
> +set ERRORLEVEL=1
> +goto end
> +
> +:okOsCheck
> +setlocal
> +
> +if not "%GERONIMO_HOME%" == "" goto gotHome
> +set CURRENT_DIR=%cd%
> +@REM %~dp0 is expanded pathname of the current script
> +cd %~dp0..
> +@REM reference %cd% to resolve ..
> +set GERONIMO_HOME=%cd%
> +cd %CURRENT_DIR%
> +
> +:gotHome
> +if exist "%GERONIMO_HOME%\bin\geronimo.bat" goto okHome
> +echo The GERONIMO_HOME environment variable is not defined correctly
> +echo This environment variable is needed to run this program
> +set ERRORLEVEL=1
> +goto end
> +:okHome
> +
> +@REM Get standard environment variables
> +@REM Users can optionally create this file to set environment variables.
> +if exist "%GERONIMO_HOME%\bin\setenv.bat" call
> "%GERONIMO_HOME%\bin\setenv.bat"
> +if not %errorlevel% == 0 goto end
> +
> +@REM Get standard Java environment variables (based upon Tomcat's
> setclasspath.bat
> +@REM but renamed since Geronimo's classpath is set in the JAR manifest)
> +if exist "%GERONIMO_HOME%\bin\setjavaenv.bat" goto okSetJavaEnv
> +echo Cannot find %GERONIMO_HOME%\bin\setclasspath.bat
> +echo This file is needed to run this program
> +set ERRORLEVEL=1
> +goto end
> +:okSetJavaEnv
> +set BASEDIR=%GERONIMO_HOME%
> +call "%GERONIMO_HOME%\bin\setJavaEnv.bat"
> +if not %errorlevel% == 0 goto end
> +
> +if not "%GERONIMO_BASE%" == "" goto gotBase
> +set GERONIMO_BASE=%GERONIMO_HOME%
> +:gotBase
> +
> +if not "%GERONIMO_TMPDIR%" == "" goto gotTmpdir
> +set GERONIMO_TMPDIR=%GERONIMO_BASE%\var\temp
> +:gotTmpdir
> +
> +@REM ----- Execute The Requested Command
> ---------------------------------------
> +
> +echo Using GERONIMO_BASE:   %GERONIMO_BASE%
> +echo Using GERONIMO_HOME:   %GERONIMO_HOME%
> +echo Using GERONIMO_TMPDIR: %GERONIMO_TMPDIR%
> +if "%_REQUIRE_JDK%" == "1" echo Using JAVA_HOME:       %JAVA_HOME%
> +if "%_REQUIRE_JDK%" == "0" echo Using JRE_HOME:        %JRE_HOME%
> +
> +set _EXECJAVA=%_RUNJAVA%
> +@REM MAINCLASS required for jdb debugger as it requires the mainclass
> +@REM parameter. For other commands, the main class is obtained from
> +@REM the JAR manifest.
> +set MAINCLASS=org.apache.geronimo.system.main.Daemon
> +set JPDA=
> +set _JARFILE="%GERONIMO_HOME%"\bin\server.jar
> +
> +if not ""%1"" == ""jpda"" goto noJpda
> +set JPDA=jpda
> +if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
> +set JPDA_TRANSPORT=dt_shmem
> +:gotJpdaTransport
> +if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
> +set JPDA_ADDRESS=jdbconn
> +:gotJpdaAddress
> +shift
> +:noJpda
> +
> +if ""%1"" == ""debug"" goto doDebug
> +if ""%1"" == ""run"" goto doRun
> +if ""%1"" == ""start"" goto doStart
> +if ""%1"" == ""stop"" goto doStop
> +
> +echo Usage:  geronimo command [args]
> +echo commands:
> +echo   debug             Debug Geronimo in jdb debugger
> +echo   jpda start        Start Geronimo under JPDA debugger
> +echo   run               Start Geronimo in the current window
> +echo   start             Start Geronimo in a separate window
> +echo   stop              Stop Geronimo
> +echo.
> +echo args for debug, jpda start, run and start commands:
> +echo        --quiet       No startup progress
> +echo        --long        Long startup progress
> +echo   -v   --verbose     INFO log level
> +echo   -vv  --veryverbose DEBUG log level
> +echo        --override    Override configurations. USE WITH CAUTION!
> +echo        --help        Detailed help.
> +echo.
> +echo args for stop command:
> +echo        --user        Admin user
> +echo        --password    Admin password
> +echo        --port        RMI port to connect to
> +goto end
> +
> +:doDebug
> +shift
> +set _EXECJAVA=%_RUNJDB%
> +if not "%JDB_OPTS%" == "" goto gotJdbOpts
> +set JDB=jdb
> +if not "%JDB_SRCPATH%" == "" goto gotJdbSrcPath
> +set JDB_SRCPATH=%GERONIMO_HOME%\src
> +:gotJdbSrcPath
> +echo Note: The jdb debugger will start Geronimo in another process and
> connect to it.
> +echo       To terminate Geronimo when running under jdb, run the
> "geronimo stop" command
> +echo       in another window.  Do not use Ctrl-C as that will terminate
> the jdb client
> +echo       (the debugger itself) but will not stop the Geronimo process.
> +goto execCmd
> +
> +:doRun
> +shift
> +goto execCmd
> +
> +:doStart
> +shift
> +@REM use long format of startup progress to be consistent with
> +@REM the unix version of the start processing
> +set _LONG_OPT=--long
> +
> +if not "%OS%" == "Windows_NT" goto noTitle
> +set _EXECJAVA=start "Geronimo" %_RUNJAVA%
> +goto gotTitle
> +:noTitle
> +set _EXECJAVA=start %_RUNJAVA%
> +:gotTitle
> +goto execCmd
> +
> +:doStop
> +shift
> +set _JARFILE="%GERONIMO_HOME%"\bin\shutdown.jar
> +goto execCmd
> +
> +:execCmd
> +@REM Get remaining unshifted command line arguments and save them in the
> +set CMD_LINE_ARGS=
> +:setArgs
> +if ""%1""=="""" goto doneSetArgs
> +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
> +shift
> +goto setArgs
> +:doneSetArgs
> +
> +@REM Execute Java with the applicable properties
> +if not "%JDB%" == "" goto doJDB
> +if not "%JPDA%" == "" goto doJpda
> +%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -Dgeronimo.base.dir="%GERONIMO_BASE%"
> -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT%
> %CMD_LINE_ARGS%
> +goto end
> +
> +:doJDB
> +%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%" -
> Dgeronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%"
> -classpath %_JARFILE% %MAINCLASS% %CMD_LINE_ARGS%
> +goto end
> +
> +:doJpda
> +%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -Xdebug
> -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n
> %DEBUG_OPTS% -Dgeronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%"
> -jar %_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
> +goto end
> +
> +:end
> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>
> Propchange: geronimo/trunk/modules/scripts/src/resources/bin/geronimo.bat
>
> ------------------------------------------------------------------------------
>     svn:executable = *
>
> Added: geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh
> URL:
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh?rev=355034&view=auto
>
> ==============================================================================
> --- geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh (added)
> +++ geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh Thu
> Dec  8 00:14:08 2005
> @@ -0,0 +1,326 @@
> +#!/bin/sh
> +#
> +#  Copyright 2005 The Apache Software Foundation
> +#
> +#   Licensed under the Apache License, Version 2.0 (the "License");
> +#   you may not use this file except in compliance with the License.
> +#   You may obtain a copy of the License at
> +#
> +#      http://www.apache.org/licenses/LICENSE-2.0
> +#
> +#   Unless required by applicable law or agreed to in writing, software
> +#   distributed under the License is distributed on an "AS IS" BASIS,
> +#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +#   See the License for the specific language governing permissions and
> +#   limitations under the License.
> +
> +# --------------------------------------------------------------------
> +# $Rev$ $Date$
> +# --------------------------------------------------------------------
> +
> +#
> -----------------------------------------------------------------------------
> +# Start/Stop Script for the Geronimo Server
> +#
> +# This script is based upon Tomcat's catalina.sh file to enable
> +# those familiar with Tomcat to quickly get started with Geronimo.
> +#
> +# For usage information, just run geronimo.sh without any arguments.
> +#
> +# Environment Variable Prequisites
> +#
> +#   GERONIMO_HOME   May point at your Geronimo top-level directory.
> +#
> +#   GERONIMO_BASE   (Optional) Base directory for resolving dynamic
> portions
> +#                   of a Geronimo installation.  If not present, resolves
> to
> +#                   the same directory that GERONIMO_HOME points to.
> +#
> +#   GERONIMO_OPTS   (Optional) Java runtime options used when the
> "start",
> +#                   "stop", or "run" command is executed.
> +#
> +#   GERONIMO_OUT    (Optional) File that Geronimo's stdout and stderr
> streams
> +#                   will be redirected to if Geronimo is started in the
> +#                   background.
> +#                   Defaults to $GERONIMO_BASE/var/log/geronimo.out
> +#
> +#   GERONIMO_PID    (Optional) Path of the file which should contains the
> pid
> +#                   of catalina startup java process, when start (fork)
> is used
> +#
> +#   GERONIMO_TMPDIR (Optional) Directory path location of temporary
> directory
> +#                   the JVM should use (java.io.tmpdir).
> +#                   Defaults to $GERONIMO_BASE/var/temp.
> +#
> +#   JAVA_HOME       Points to your Java Development Kit installation.
> +#                   JAVA_HOME doesn't need to be set if JRE_HOME is set
> +#                   unless you use the "debug" command.
> +#                   It is mandatory either JAVA_HOME or JRE_HOME are set.
> +#
> +#   JRE_HOME        Points to your Java Runtime Environment installation.
> +#                   Set this if you wish to run Geronimo using the JRE
> +#                   instead of the JDK (except for the "debug" command).
> +#                   Defaults to JAVA_HOME if empty.
> +#                   It is mandatory either JAVA_HOME or JRE_HOME are set.
> +#
> +#   JAVA_OPTS       (Optional) Java runtime options used when the
> "start",
> +#                   "stop", or "run" command is executed.
> +#
> +#   JDB_SRCPATH     (Optional) The Source Path to be used by jdb debugger
> +#                   when the "debug" command is executed.
> +#                   Defaults to %GERONIMO_HOME%\src
> +#
> +#   JPDA_TRANSPORT  (Optional) JPDA transport used when the "jpda start"
> +#                   command is executed. The default is "dt_socket".
> +#
> +#   JPDA_ADDRESS    (Optional) Java runtime options used when the "jpda
> start"
> +#                   command is executed. The default is 8000.
> +#
> +#   START_OS_CMD    (Optional) Operating system command that will be
> placed in
> +#                   front of the java command when starting Geronimo in
> the
> +#                   background.  This can be useful on operating systems
> where
> +#                   the OS provides a command that allows you to start a
> process
> +#                   with in a specified CPU or priority.
> +#
> +# Scripts called by this script:
> +#
> +#   $GERONIMO_HOME/bin/setenv.sh
> +#                   (Optional) This script file is called if it is
> present.
> +#                   Its contents may set one or more of the above
> environment
> +#                   variables.
> +#
> +#   $GERONIMO_HOME/bin/setjavaenv.sh
> +#                   This batch file is called to set environment
> variables
> +#                   relating to the java or jdb executable to invoke.
> +#                   This file should not need to be modified.
> +#
> +# Exit Codes:
> +#
> +#  0 - Success
> +#  1 - Error
> +#
> -----------------------------------------------------------------------------
> +
> +# OS specific support.  $var _must_ be set to either true or false.
> +cygwin=false
> +os400=false
> +case "`uname`" in
> +CYGWIN*) cygwin=true;;
> +OS400*) os400=true;;
> +esac
> +
> +# resolve links - $0 may be a softlink
> +PRG="$0"
> +
> +while [ -h "$PRG" ]; do
> +  ls=`ls -ld "$PRG"`
> +  link=`expr "$ls" : '.*-> \(.*\)$'`
> +  if expr "$link" : '.*/.*' > /dev/null; then
> +    PRG="$link"
> +  else
> +    PRG=`dirname "$PRG"`/"$link"
> +  fi
> +done
> +
> +# Get standard environment variables
> +PRGDIR=`dirname "$PRG"`
> +
> +# Only set GERONIMO_HOME if not already set
> +[ -z "$GERONIMO_HOME" ] && GERONIMO_HOME=`cd "$PRGDIR/.." ; pwd`
> +
> +if [ -r "$GERONIMO_HOME"/bin/setenv.sh ]; then
> +  . "$GERONIMO_HOME"/bin/setenv.sh
> +fi
> +
> +# For Cygwin, ensure paths are in UNIX format before anything is touched
> +if $cygwin; then
> +  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
> +  [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
> +  [ -n "$JDB_SRCPATH" ] && JDB_SRCPATH=`cygpath --unix "$JDB_SRCPATH"`
> +  [ -n "$GERONIMO_HOME" ] && GERONIMO_HOME=`cygpath --unix
> "$GERONIMO_HOME"`
> +  [ -n "$GERONIMO_BASE" ] && GERONIMO_BASE=`cygpath --unix
> "$GERONIMO_BASE"`
> +fi
> +
> +# For OS400
> +if $os400; then
> +  # Set job priority to standard for interactive (interactive - 6) by
> using
> +  # the interactive priority - 6, the helper threads that respond to
> requests
> +  # will be running at the same priority as interactive jobs.
> +  COMMAND='chgjob job('$JOBNAME') runpty(6)'
> +  system $COMMAND
> +
> +  # Enable multi threading
> +  export QIBM_MULTI_THREADED=Y
> +fi
> +
> +# Get standard Java environment variables
> +# (based upon Tomcat's setclasspath.sh but renamed since Geronimo's
> classpath
> +# is set in the JAR manifest)
> +if $os400; then
> +  # -r will Only work on the os400 if the files are:
> +  # 1. owned by the user
> +  # 2. owned by the PRIMARY group of the user
> +  # this will not work if the user belongs in secondary groups
> +  BASEDIR="$GERONIMO_HOME"
> +  . "$GERONIMO_HOME"/bin/setjavaenv.sh
> +else
> +  if [ -r "$GERONIMO_HOME"/bin/setjavaenv.sh ]; then
> +    BASEDIR="$GERONIMO_HOME"
> +    . "$GERONIMO_HOME"/bin/setjavaenv.sh
> +  else
> +    echo "Cannot find $GERONIMO_HOME/bin/setjavaenv.sh"
> +    echo "This file is needed to run this program"
> +    exit 1
> +  fi
> +fi
> +
> +if [ -z "$GERONIMO_BASE" ] ; then
> +  GERONIMO_BASE="$GERONIMO_HOME"
> +fi
> +
> +if [ -z "$GERONIMO_TMPDIR" ] ; then
> +  # Define the java.io.tmpdir to use for Geronimo
> +  GERONIMO_TMPDIR="$GERONIMO_BASE"/var/temp
> +fi
> +
> +if [ -z "$GERONIMO_OUT" ] ; then
> +  # Define the output file we are to redirect both stdout and stderr to
> +  # when Geronimo is started in the background
> +  GERONIMO_OUT="$GERONIMO_BASE"/var/log/geronimo.out
> +fi
> +
> +if [ -z "$JDB_SRCPATH" ] ; then
> +  # Define the source path to be used by the JDB debugger
> +  JDB_SRCPATH="$GERONIMO_HOME"/src
> +fi
> +
> +# For Cygwin, switch paths to Windows format before running java
> +if $cygwin; then
> +  JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
> +  JRE_HOME=`cygpath --absolute --windows "$JRE_HOME"`
> +  JDB_SRCPATH=`cygpath --absolute --windows "$JDB_SRCPATH"`
> +  GERONIMO_HOME=`cygpath --absolute --windows "$GERONIMO_HOME"`
> +  GERONIMO_BASE=`cygpath --absolute --windows "$GERONIMO_BASE"`
> +  GERONIMO_TMPDIR=`cygpath --absolute --windows "$GERONIMO_TMPDIR"`
> +fi
> +
> +# ----- Execute The Requested Command
> -----------------------------------------
> +
> +echo "Using GERONIMO_BASE:   $GERONIMO_BASE"
> +echo "Using GERONIMO_HOME:   $GERONIMO_HOME"
> +echo "Using GERONIMO_TMPDIR: $GERONIMO_TMPDIR"
> +if [ "$1" = "debug" ] ; then
> +  echo "Using JAVA_HOME:       $JAVA_HOME"
> +  echo "Using JDB_SRCPATH:     $JDB_SRCPATH"
> +else
> +  echo "Using JRE_HOME:        $JRE_HOME"
> +fi
> +
> +LONG_OPT=
> +if [ "$1" = "start" ] ; then
> +  LONG_OPT=--long
> +  echo "Using GERONIMO_OUT:    $GERONIMO_OUT"
> +fi
> +
> +if [ "$1" = "jpda" ] ; then
> +  if [ -z "$JPDA_TRANSPORT" ]; then
> +    JPDA_TRANSPORT="dt_socket"
> +  fi
> +  if [ -z "$JPDA_ADDRESS" ]; then
> +    JPDA_ADDRESS="8000"
> +  fi
> +  if [ -z "$JPDA_OPTS" ]; then
> +    JPDA_OPTS="-Xdebug
> -Xrunjdwp:transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=n"
> +  fi
> +  LONG_OPT=--long
> +  GERONIMO_OPTS="$GERONIMO_OPTS $JPDA_OPTS"
> +  shift
> +fi
> +
> +if [ "$1" = "debug" ] ; then
> +  if $os400; then
> +    echo "Debug command not available on OS400"
> +    exit 1
> +  else
> +    echo "Note: The jdb debugger will start Geronimo in another process
> and connect to it."
> +    echo "      To terminate Geronimo when running under jdb, run the
> "geronimo stop" command"
> +    echo "      in another window.  Do not use Ctrl-C as that will
> terminate the jdb client"
> +    echo "      (the debugger itself) but will not stop the Geronimo
> process."
> +    shift
> +    exec "$_RUNJDB" $JAVA_OPTS $GERONIMO_OPTS \
> +      -sourcepath "$JDB_SRCPATH" \
> +      -Dgeronimo.base.dir="$GERONIMO_BASE" \
> +      -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
> +      -classpath "$GERONIMO_HOME"/bin/server.jar \
> +      org.apache.geronimo.system.main.Daemon $LONG_OPT "$@"
> +  fi
> +
> +elif [ "$1" = "run" ]; then
> +
> +  shift
> +  exec "$_RUNJAVA" $JAVA_OPTS $GERONIMO_OPTS \
> +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> +    -Dgeronimo.base.dir="$GERONIMO_BASE" \
> +    -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
> +    -jar "$GERONIMO_HOME"/bin/server.jar $LONG_OPT "$@"
> +
> +elif [ "$1" = "start" ] ; then
> +
> +  shift
> +  touch $GERONIMO_OUT
> +  $START_OS_CMD "$_RUNJAVA" $JAVA_OPTS $GERONIMO_OPTS \
> +    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
> +    -Dgeronimo.base.dir="$GERONIMO_BASE" \
> +    -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
> +    -jar "$GERONIMO_HOME"/bin/server.jar $LONG_OPT "$@" \
> +    >> $GERONIMO_OUT 2>&1 &
> +
> +    if [ ! -z "$GERONIMO_PID" ]; then
> +      echo $! > $GERONIMO_PID
> +    fi
> +
> +elif [ "$1" = "stop" ] ; then
> +
> +  shift
> +  FORCE=0
> +# support -force as that is the option Tomcat uses, we will document
> +# --force as the option to be consistent with other Geronimo options.
> +  if [ "$1" = "--force" -o "$1" = "-force" ]; then
> +    shift
> +    FORCE=1
> +  fi
> +
> +  "$_RUNJAVA" $JAVA_OPTS $GERONIMO_OPTS \
> +    -Dgeronimo.base.dir="$GERONIMO_BASE" \
> +    -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
> +    -jar "$GERONIMO_HOME"/bin/shutdown.jar "$@"
> +
> +  if [ $FORCE -eq 1 ]; then
> +    if [ ! -z "$GERONIMO_PID" ]; then
> +       echo "Killing: `cat $GERONIMO_PID`"
> +       kill -9 `cat $GERONIMO_PID`
> +    fi
> +  fi
> +
> +else
> +
> +  echo "Usage: geronimo.sh command [geronimo_args]"
> +  echo "commands:"
> +  echo "  debug             Debug Geronimo in jdb debugger"
> +  echo "  jpda start        Start Geronimo under JPDA debugger"
> +  echo "  run               Start Geronimo in the foreground"
> +  echo "  start             Start Geronimo in the background"
> +  echo "  stop              Stop Geronimo"
> +  echo "  stop --force      Stop Geronimo (followed by kill -KILL)"
> +  echo ""
> +  echo "args for debug, jpda start, run and start commands:"
> +  echo "       --quiet       No startup progress"
> +  echo "       --long        Long startup progress"
> +  echo "  -v   --verbose     INFO log level"
> +  echo "  -vv  --veryverbose DEBUG log level"
> +  echo "       --override    Override configurations. USE WITH CAUTION!"
> +  echo "       --help        Detailed help."
> +  echo ""
> +  echo "args for stop command:"
> +  echo "       --user        Admin user"
> +  echo "       --password    Admin password"
> +  echo "       --port        RMI port to connect to"
> +  exit 1
> +
> +fi
>
> Propchange: geronimo/trunk/modules/scripts/src/resources/bin/geronimo.sh
>
> ------------------------------------------------------------------------------
>     svn:executable = *
>
> Added: geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat
> URL:
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat?rev=355034&view=auto
>
> ==============================================================================
> --- geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat
> (added)
> +++ geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat Thu
> Dec  8 00:14:08 2005
> @@ -0,0 +1,91 @@
> +@REM
> +@REM  Copyright 2005 The Apache Software Foundation
> +@REM
> +@REM   Licensed under the Apache License, Version 2.0 (the "License");
> +@REM   you may not use this file except in compliance with the License.
> +@REM   You may obtain a copy of the License at
> +@REM
> +@REM      http://www.apache.org/licenses/LICENSE-2.0
> +@REM
> +@REM   Unless required by applicable law or agreed to in writing,
> software
> +@REM   distributed under the License is distributed on an "AS IS" BASIS,
> +@REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +@REM   See the License for the specific language governing permissions
> and
> +@REM   limitations under the License.
> +@REM
> +@REM --------------------------------------------------------------------
> +@REM Set environment variables relating to the execution of java commands
> +@REM
> +@REM This batch file is called by the geronimo.bat file.
> +@REM
> +@REM (based upon Apache Tomcat 5.5.12's setclasspath.bat although
> modified
> +@REM to be more consistent with the shell script version's support of
> +@REM JDK_HOME and JRE_HOME)
> +@REM
> +@REM $Rev$ $Date$
> +@REM --------------------------------------------------------------------
> +
> +@REM Begin all @REM lines with '@' in case GERONIMO_BATCH_ECHO is 'on'
> +@if "%GERONIMO_BATCH_ECHO%" == "on"  echo on
> +@if not "%GERONIMO_BATCH_ECHO%" == "on"  echo off
> +
> +@REM check that either JAVA_HOME or JRE_HOME are set
> +set jdkOrJreHomeSet=0
> +if not "%JAVA_HOME%" == "" set jdkOrJreHomeSet=1
> +if not "%JRE_HOME%" == "" set jdkOrJreHomeSet=1
> +if "%jdkOrJreHomeSet%" == "1" goto gotJdkOrJreHome
> +echo Neither the JAVA_HOME nor the JRE_HOME environment variable is
> defined
> +echo At least one of these environment variable is needed to run this
> program
> +set ERRORLEVEL=1
> +goto end
> +
> +@REM If we get this far we have either JAVA_HOME or JRE_HOME set
> +@REM now check whether the command requires the JDK and if so
> +@REM check that JAVA_HOME is really pointing to the JDK files.
> +:gotJdkOrJreHome
> +set _REQUIRE_JDK=0
> +if "%1" == "debug" set _REQUIRE_JDK=1
> +if "%_REQUIRE_JDK%" == "0" goto okJdkFileCheck
> +
> +set jdkNotFound=0
> +if not exist "%JAVA_HOME%\bin\java.exe" set jdkNotFound=1
> +if not exist "%JAVA_HOME%\bin\javaw.exe" set jdkNotFound=1
> +if not exist "%JAVA_HOME%\bin\jdb.exe" set jdkNotFound=1
> +if not exist "%JAVA_HOME%\bin\javac.exe" set jdkNotFound=1
> +if %jdkNotFound% == 0 goto okJdkFileCheck
> +echo The JAVA_HOME environment variable is not defined correctly
> +echo This environment variable is needed to run this program
> +echo NB: JAVA_HOME should point to a JDK not a JRE
> +set ERRORLEVEL=1
> +goto end
> +
> +:okJdkFileCheck
> +@REM default JRE_HOME to JAVA_HOME if not set.
> +if "%JRE_HOME%" == "" set JRE_HOME=%JAVA_HOME%
> +
> +if not "%BASEDIR%" == "" goto gotBasedir
> +echo The BASEDIR environment variable is not defined
> +echo This environment variable is needed to run this program
> +set ERRORLEVEL=1
> +goto end
> +
> +:gotBasedir
> +if exist "%BASEDIR%\bin\setjavaenv.bat" goto okBasedir
> +echo The BASEDIR environment variable is not defined correctly
> +echo This environment variable is needed to run this program
> +set ERRORLEVEL=1
> +goto end
> +
> +:okBasedir
> +@REM Set standard command for invoking Java.
> +@REM Note that NT requires a window name argument when using start.
> +@REM Also note the quoting as JAVA_HOME may contain spaces.
> +set _RUNJAVA="%JRE_HOME%\bin\java"
> +set _RUNJAVAW="%JRE_HOME%\bin\javaw"
> +set _RUNJDB="%JAVA_HOME%\bin\jdb"
> +
> +goto end
> +
> +:end
> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>
> Propchange:
> geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.bat
>
> ------------------------------------------------------------------------------
>     svn:executable = *
>
> Added: geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh
> URL:
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh?rev=355034&view=auto
>
> ==============================================================================
> --- geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh (added)
> +++ geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh Thu
> Dec  8 00:14:08 2005
> @@ -0,0 +1,82 @@
> +#!/bin/sh
> +#
> +#  Copyright 2005 The Apache Software Foundation
> +#
> +#   Licensed under the Apache License, Version 2.0 (the "License");
> +#   you may not use this file except in compliance with the License.
> +#   You may obtain a copy of the License at
> +#
> +#      http://www.apache.org/licenses/LICENSE-2.0
> +#
> +#   Unless required by applicable law or agreed to in writing, software
> +#   distributed under the License is distributed on an "AS IS" BASIS,
> +#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> +#   See the License for the specific language governing permissions and
> +#   limitations under the License.
> +
> +# --------------------------------------------------------------------
> +# Set environment variables relating to the execution of java commands
> +#
> +# This script file is called by the geronimo.sh file.
> +#
> +# (based upon Apache Tomcat 5.5.12's setclasspath.sh)
> +#
> +# $Rev$ $Date$
> +# --------------------------------------------------------------------
> +
> +# Make sure prerequisite environment variables are set
> +if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
> +  echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is
> defined"
> +  echo "At least one of these environment variable is needed to run this
> program"
> +  exit 1
> +fi
> +if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
> +  echo "JAVA_HOME should point to a JDK in order to run in debug mode."
> +  exit 1
> +fi
> +if [ -z "$JRE_HOME" ]; then
> +  JRE_HOME="$JAVA_HOME"
> +fi
> +
> +# If we're running under jdb, we need a full jdk.
> +if [ "$1" = "debug" ] ; then
> +  if [ "$os400" = "true" ]; then
> +    if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ];
> then
> +      echo "The JAVA_HOME environment variable is not defined correctly"
> +      echo "This environment variable is needed to run this program"
> +      echo "NB: JAVA_HOME should point to a JDK not a JRE"
> +      exit 1
> +    fi
> +  else
> +    if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x
> "$JAVA_HOME"/bin/javac ]; then
> +      echo "The JAVA_HOME environment variable is not defined correctly"
> +      echo "This environment variable is needed to run this program"
> +      echo "NB: JAVA_HOME should point to a JDK not a JRE"
> +      exit 1
> +    fi
> +  fi
> +fi
> +if [ -z "$BASEDIR" ]; then
> +  echo "The BASEDIR environment variable is not defined"
> +  echo "This environment variable is needed to run this program"
> +  exit 1
> +fi
> +if [ ! -x "$BASEDIR"/bin/setjavaenv.sh ]; then
> +  if $os400; then
> +    # -x will Only work on the os400 if the files are:
> +    # 1. owned by the user
> +    # 2. owned by the PRIMARY group of the user
> +    # this will not work if the user belongs in secondary groups
> +    eval
> +  else
> +    echo "The BASEDIR environment variable is not defined correctly"
> +    echo "This environment variable is needed to run this program"
> +    exit 1
> +  fi
> +fi
> +
> +# Set standard commands for invoking Java.
> +  _RUNJAVA="$JRE_HOME"/bin/java
> +if [ "$os400" != "true" ]; then
> +  _RUNJDB="$JAVA_HOME"/bin/jdb
> +fi
>
> Propchange: geronimo/trunk/modules/scripts/src/resources/bin/setjavaenv.sh
>
> ------------------------------------------------------------------------------
>     svn:executable = *
>
>
>

Mime
View raw message