You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dw...@apache.org on 2008/06/09 18:00:31 UTC

svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Author: dwoods
Date: Mon Jun  9 09:00:31 2008
New Revision: 665729

URL: http://svn.apache.org/viewvc?rev=665729&view=rev
Log:
GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for determining the Java runtime, allow users to continue to supply a setenv script and updated the Unix gsh script with some missing Cygwin, OS400 and error checking that was in geronimo.sh.

Modified:
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server
    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh Mon Jun  9 09:00:31 2008
@@ -22,42 +22,90 @@
 ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
 ##
 
-DIRNAME=`dirname "$0"`
-
 # OS specific support (must be 'true' or 'false').
 cygwin=false
+os400=false
 case "`uname`" in
-    CYGWIN*)
-        cygwin=true
-        ;;
+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
+
+PRGDIR=`dirname "$PRG"`
+
+# Locate GSHELL_HOME if not it is not set
+if [ "x$GSHELL_HOME" = "x" ]; then
+    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
+fi
+
+# Execute optional environment  if provided by the user
+if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
+    . "$GSHELL_HOME"/bin/setenv.sh
+fi
+
 # For Cygwin, ensure paths are in UNIX format before anything is touched
 if $cygwin ; then
-    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix "$GSHELL_HOME"`
-    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
+    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
     [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix "$GSHELL_HOME"`
 fi
 
-# Locate GSHELL_HOME if not it is not set
-if [ "x$GSHELL_HOME" = "x" ]; then
-    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
+# 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
 
-# Determine the Java command to use to start the JVM
-if [ -z "$JAVACMD" ]; then
-    if [ -n "$JAVA_HOME" ]; then
-        JAVACMD="$JAVA_HOME/bin/java"
+# 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="$GSHELL_HOME"
+    . "$GSHELL_HOME"/bin/setjavaenv.sh
+else
+    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
+        BASEDIR="$GSHELL_HOME"
+        . "$GSHELL_HOME"/bin/setjavaenv.sh
     else
-        JAVACMD="java"
+        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
+        echo "This file is needed to run this program"
+        exit 1
     fi
 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"`
+    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
+fi
+
 BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
 if $cygwin ; then
     BOOTJAR=`cygpath --windows "$BOOTJAR"`
 fi
 
 # Start the JVM
-exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
+exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
 

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat Mon Jun  9 09:00:31 2008
@@ -1,82 +1,86 @@
-@if "%DEBUG%" == "" @echo off
-rem 
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements.  See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership.  The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License.  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,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied.  See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-rem 
-
-rem 
-rem $Rev$ $Date$
-rem 
-
-if "%OS%"=="Windows_NT" setlocal enableextensions
-set ERRORLEVEL=0
-
-:begin
+@rem 
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  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,
+@rem software distributed under the License is distributed on an
+@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@rem KIND, either express or implied.  See the License for the
+@rem specific language governing permissions and limitations
+@rem under the License.
+@rem 
+
+@rem 
+@rem $Rev$ $Date$
+@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 command - you are running an unsupported operating system.
+set ERRORLEVEL=1
+goto end
+
+:okOsCheck
+@setlocal enableextensions
+@set ERRORLEVEL=0
 
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.\
+cd /d %DIRNAME%
 
-:check_JAVACMD
-if not "%JAVACMD%" == "" goto check_GSHELL_HOME
-
-:check_JAVA_HOME
-if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
-set JAVACMD=java
-goto check_GSHELL_HOME
-
-:have_JAVA_HOME
-set JAVACMD=%JAVA_HOME%\bin\java
-goto check_GSHELL_HOME
+@REM Get standard environment variables
+@REM Users can optionally create this file to set environment variables.
+if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
+if not %errorlevel% == 0 goto end
+
+@REM Get standard Java environment variables
+if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
+echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
+set ERRORLEVEL=1
+goto end
+:okSetJavaEnv
+set BASEDIR=%DIRNAME%
+call "%DIRNAME%\setJavaEnv.bat"
+if not %errorlevel% == 0 goto end
 
 :check_GSHELL_HOME
 if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
 
 :init
-rem Get command-line arguments, handling Windowz variants
-if not "%OS%" == "Windows_NT" goto win9xME_args
+rem Get command-line arguments, handling Windows variants
 if "%eval[2+2]" == "4" goto 4NT_args
 
 rem Regular WinNT shell
-set ARGS=%*
-goto execute
-
-:win9xME_args
-rem Slurp the command line arguments.  This loop allows for an unlimited number
 set ARGS=
-
-:win9xME_args_slurp
-if "x%1" == "x" goto execute
+:setArgs
+if ""%1""=="""" goto doneSetArgs
 set ARGS=%ARGS% %1
 shift
-goto win9xME_args_slurp
+goto setArgs
+:doneSetArgs
+goto execute
 
 :4NT_args
 rem Get arguments from the 4NT Shell from JP Software
 set ARGS=%$
 
 :execute
-
 set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
 
 rem Start the JVM
-"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
+%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
 
 :end
-
-if "%OS%"=="Windows_NT" endlocal
-if "%GSHELL_BATCH_PAUSE%" == "on" pause
-
+:end
+@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
+if "%GERONIMO_BATCH_PAUSE%" == "on" pause
+@endlocal

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server Mon Jun  9 09:00:31 2008
@@ -22,7 +22,61 @@
 ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
 ##
 
-DIRNAME=`dirname "$0"`
+# --------------------------------------------------------------------
+# Startup script for Geronimo that starts Geronimo in the foreground.
+#
+# This script calls the gsh script passing "geronimo/start-server" as the
+# first argument followed by the arguments supplied by the caller.
+#
+# Alternatively you can use the more comprehensive gsh interface directly.
+#
+# Invocation Syntax:
+#
+#   start-server [geronimo_args ...]
+#
+# Environment Variable Prequisites:
+#
+#   Refer to the documentation in the gsh file for information
+#   on environment variables etc.
+#
+# --------------------------------------------------------------------
+
+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
+
+PRGDIR=`dirname "$PRG"`
+EXECUTABLE=gsh
+
+# Check that target executable exists
+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
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi
 
 ARGS=
 while [ $# -ge 1 ]; do
@@ -30,5 +84,5 @@
   shift
 done
 
-exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
+exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
 

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat Mon Jun  9 09:00:31 2008
@@ -1,37 +1,82 @@
-@if "%DEBUG%" == "" @echo off
-rem 
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements.  See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership.  The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License.  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,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied.  See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-rem 
-
-rem 
-rem $Rev$ $Date$
-rem 
-
-if "%OS%"=="Windows_NT" setlocal
-
-:begin
+@rem 
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  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,
+@rem software distributed under the License is distributed on an
+@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@rem KIND, either express or implied.  See the License for the
+@rem specific language governing permissions and limitations
+@rem under the License.
+@rem 
+
+@rem 
+@rem $Rev$ $Date$
+@rem 
+
+@rem --------------------------------------------------------------------
+@rem start-server batch file for Geronimo that starts Geronimo in foreground.
+@rem
+@rem This batch file calls the gsh.bat script passing "geronimo/start-server
+@rem followed by the arguments supplied by the caller.
+@rem
+@rem Alternatively you can use the more comprehensive gsh.bat file directly.
+@rem
+@rem Invocation Syntax:
+@rem
+@rem   start-server [geronimo_args ...]
+@rem
+@rem Environment Variable Prequisites:
+@rem
+@rem   Refer to the GShell documentation for information on environment
+@rem   variables etc.
+@rem
+@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 command - you are running an unsupported operating system.
+set ERRORLEVEL=1
+goto end
+
+:okOsCheck
+@setlocal enableextensions
+@set ERRORLEVEL=0
 
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.\
+cd /d %DIRNAME%
 
-"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
+set EXECUTABLE=%DIRNAME%\gsh.bat
 
-:end
+@REM Check that target executable exists
+if exist "%EXECUTABLE%" goto okExec
+echo ERROR - Cannot find required script %EXECUTABLE%
+set ERRORLEVEL=1
+goto end
+
+:okExec
+@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
 
-if "%OS%"=="Windows_NT" endlocal
+call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
 
+:end
+@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
+if "%GERONIMO_BATCH_PAUSE%" == "on" pause
+@endlocal

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server Mon Jun  9 09:00:31 2008
@@ -22,7 +22,61 @@
 ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
 ##
 
-DIRNAME=`dirname "$0"`
+# --------------------------------------------------------------------
+# Shutdown script for Geronimo that stops Geronimo in the foreground.
+#
+# This script calls the gsh script passing "geronimo/stop-server" as the
+# first argument followed by the arguments supplied by the caller.
+#
+# Alternatively you can use the more comprehensive gsh interface directly.
+#
+# Invocation Syntax:
+#
+#   stop-server [geronimo_args ...]
+#
+# Environment Variable Prequisites:
+#
+#   Refer to the documentation in the gsh file for information
+#   on environment variables etc.
+#
+# --------------------------------------------------------------------
+
+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
+
+PRGDIR=`dirname "$PRG"`
+EXECUTABLE=gsh
+
+# Check that target executable exists
+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
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi
 
 ARGS=
 while [ $# -ge 1 ]; do
@@ -30,5 +84,5 @@
   shift
 done
 
-exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
+exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
 

Modified: geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff
==============================================================================
--- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat (original)
+++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat Mon Jun  9 09:00:31 2008
@@ -1,37 +1,82 @@
-@if "%DEBUG%" == "" @echo off
-rem 
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements.  See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership.  The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License.  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,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied.  See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-rem 
-
-rem 
-rem $Rev$ $Date$
-rem 
-
-if "%OS%"=="Windows_NT" setlocal
-
-:begin
+@rem 
+@rem Licensed to the Apache Software Foundation (ASF) under one
+@rem or more contributor license agreements.  See the NOTICE file
+@rem distributed with this work for additional information
+@rem regarding copyright ownership.  The ASF licenses this file
+@rem to you under the Apache License, Version 2.0 (the
+@rem "License"); you may not use this file except in compliance
+@rem with the License.  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,
+@rem software distributed under the License is distributed on an
+@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@rem KIND, either express or implied.  See the License for the
+@rem specific language governing permissions and limitations
+@rem under the License.
+@rem 
+
+@rem 
+@rem $Rev$ $Date$
+@rem 
+
+@rem --------------------------------------------------------------------
+@rem stop-server batch file for Geronimo that stops Geronimo in foreground.
+@rem
+@rem This batch file calls the gsh.bat script passing "geronimo/stop-server
+@rem followed by the arguments supplied by the caller.
+@rem
+@rem Alternatively you can use the more comprehensive gsh.bat file directly.
+@rem
+@rem Invocation Syntax:
+@rem
+@rem   stop-server [geronimo_args ...]
+@rem
+@rem Environment Variable Prequisites:
+@rem
+@rem   Refer to the GShell documentation for information on environment
+@rem   variables etc.
+@rem
+@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 command - you are running an unsupported operating system.
+set ERRORLEVEL=1
+goto end
+
+:okOsCheck
+@setlocal enableextensions
+@set ERRORLEVEL=0
 
 set DIRNAME=%~dp0
 if "%DIRNAME%" == "" set DIRNAME=.\
+cd /d %DIRNAME%
 
-"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
+set EXECUTABLE=%DIRNAME%\gsh.bat
 
-:end
+@REM Check that target executable exists
+if exist "%EXECUTABLE%" goto okExec
+echo ERROR - Cannot find required script %EXECUTABLE%
+set ERRORLEVEL=1
+goto end
+
+:okExec
+@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
 
-if "%OS%"=="Windows_NT" endlocal
+call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
 
+:end
+@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
+if "%GERONIMO_BATCH_PAUSE%" == "on" pause
+@endlocal



Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Kevan Miller <ke...@gmail.com>.
On Jun 9, 2008, at 7:47 PM, Donald Woods wrote:

> If you can point me to GShell docs or specific source files in 1.0- 
> alpha1-1 on how to create platform specific settings (like OS400,  
> 4NT, Cygwin, ...) then I'd be happy to take a look at reducing the  
> cruft....  But for now, I was trying to make sure the current gsh  
> scripts support the same platforms/shells as the long used and  
> tested geronimo scripts.
>
>
> -Donald
>
>
> David Jencks wrote:
>> I am not sure I understand the full content of this change, but I  
>> am definitely -1 on running any user supplied platform specific  
>> scripts without a compelling documented use case showing why we  
>> can't use gshell groovy scripts instead.  We have gshell, lets use  
>> it.
>> thanks
>> david jencks
>> On Jun 9, 2008, at 9:11 AM, Jason Dillon wrote:
>>> Pffff... I really dislike all this crap in the native platform  
>>> scripts.  Just why is all this junk needed?
>>>
>>> What is the os400 muck for?  Why do we care about resolving soft- 
>>> links?
>>>
>>> Why is setjavaenv.sh required?
>>>
>>> Ugh... I think this is a mess.

Looks like we need to bring this to some kind of conclusion... Are  
things ok where they currently stand? Or do we need to discuss this  
some more?

--kevan


Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Donald Woods <dw...@apache.org>.
If you can point me to GShell docs or specific source files in 
1.0-alpha1-1 on how to create platform specific settings (like OS400, 
4NT, Cygwin, ...) then I'd be happy to take a look at reducing the 
cruft....  But for now, I was trying to make sure the current gsh 
scripts support the same platforms/shells as the long used and tested 
geronimo scripts.


-Donald


David Jencks wrote:
> I am not sure I understand the full content of this change, but I am 
> definitely -1 on running any user supplied platform specific scripts 
> without a compelling documented use case showing why we can't use gshell 
> groovy scripts instead.  We have gshell, lets use it.
> 
> thanks
> david jencks
> 
> On Jun 9, 2008, at 9:11 AM, Jason Dillon wrote:
> 
>> Pffff... I really dislike all this crap in the native platform 
>> scripts.  Just why is all this junk needed?
>>
>> What is the os400 muck for?  Why do we care about resolving soft-links?
>>
>> Why is setjavaenv.sh required?
>>
>> Ugh... I think this is a mess.
>>
>> --jason
>>
>>
>> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
>>
>>> Author: dwoods
>>> Date: Mon Jun  9 09:00:31 2008
>>> New Revision: 665729
>>>
>>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>>> Log:
>>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for 
>>> determining the Java runtime, allow users to continue to supply a 
>>> setenv script and updated the Unix gsh script with some missing 
>>> Cygwin, OS400 and error checking that was in geronimo.sh.
>>>
>>> Modified:
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>
>>>   
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -22,42 +22,90 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> -
>>> # OS specific support (must be 'true' or 'false').
>>> cygwin=false
>>> +os400=false
>>> case "`uname`" in
>>> -    CYGWIN*)
>>> -        cygwin=true
>>> -        ;;
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +
>>> +# Locate GSHELL_HOME if not it is not set
>>> +if [ "x$GSHELL_HOME" = "x" ]; then
>>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>>> +fi
>>> +
>>> +# Execute optional environment  if provided by the user
>>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>>> +    . "$GSHELL_HOME"/bin/setenv.sh
>>> +fi
>>> +
>>> # For Cygwin, ensure paths are in UNIX format before anything is touched
>>> if $cygwin ; then
>>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix 
>>> "$GSHELL_HOME"`
>>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>>    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix 
>>> "$GSHELL_HOME"`
>>> fi
>>>
>>> -# Locate GSHELL_HOME if not it is not set
>>> -if [ "x$GSHELL_HOME" = "x" ]; then
>>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>>> +# 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
>>>
>>> -# Determine the Java command to use to start the JVM
>>> -if [ -z "$JAVACMD" ]; then
>>> -    if [ -n "$JAVA_HOME" ]; then
>>> -        JAVACMD="$JAVA_HOME/bin/java"
>>> +# 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="$GSHELL_HOME"
>>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>>> +else
>>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>>> +        BASEDIR="$GSHELL_HOME"
>>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>    else
>>> -        JAVACMD="java"
>>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>>> +        echo "This file is needed to run this program"
>>> +        exit 1
>>>    fi
>>> 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"`
>>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>>> +fi
>>> +
>>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>>> if $cygwin ; then
>>>    BOOTJAR=`cygpath --windows "$BOOTJAR"`
>>> fi
>>>
>>> # Start the JVM
>>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -1,82 +1,86 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>>> -set ERRORLEVEL=0
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@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 command - you are running an unsupported 
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -:check_JAVACMD
>>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>>> -
>>> -:check_JAVA_HOME
>>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>>> -set JAVACMD=java
>>> -goto check_GSHELL_HOME
>>> -
>>> -:have_JAVA_HOME
>>> -set JAVACMD=%JAVA_HOME%\bin\java
>>> -goto check_GSHELL_HOME
>>> +@REM Get standard environment variables
>>> +@REM Users can optionally create this file to set environment 
>>> variables.
>>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>>> +if not %errorlevel% == 0 goto end
>>> +
>>> +@REM Get standard Java environment variables
>>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +:okSetJavaEnv
>>> +set BASEDIR=%DIRNAME%
>>> +call "%DIRNAME%\setJavaEnv.bat"
>>> +if not %errorlevel% == 0 goto end
>>>
>>> :check_GSHELL_HOME
>>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>>
>>> :init
>>> -rem Get command-line arguments, handling Windowz variants
>>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>>> +rem Get command-line arguments, handling Windows variants
>>> if "%eval[2+2]" == "4" goto 4NT_args
>>>
>>> rem Regular WinNT shell
>>> -set ARGS=%*
>>> -goto execute
>>> -
>>> -:win9xME_args
>>> -rem Slurp the command line arguments.  This loop allows for an 
>>> unlimited number
>>> set ARGS=
>>> -
>>> -:win9xME_args_slurp
>>> -if "x%1" == "x" goto execute
>>> +:setArgs
>>> +if ""%1""=="""" goto doneSetArgs
>>> set ARGS=%ARGS% %1
>>> shift
>>> -goto win9xME_args_slurp
>>> +goto setArgs
>>> +:doneSetArgs
>>> +goto execute
>>>
>>> :4NT_args
>>> rem Get arguments from the 4NT Shell from JP Software
>>> set ARGS=%$
>>>
>>> :execute
>>> -
>>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>>
>>> rem Start the JVM
>>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>
>>> :end
>>> -
>>> -if "%OS%"=="Windows_NT" endlocal
>>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>>> -
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -22,7 +22,61 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> +# --------------------------------------------------------------------
>>> +# Startup script for Geronimo that starts Geronimo in the foreground.
>>> +#
>>> +# This script calls the gsh script passing "geronimo/start-server" 
>>> as the
>>> +# first argument followed by the arguments supplied by the caller.
>>> +#
>>> +# Alternatively you can use the more comprehensive gsh interface 
>>> directly.
>>> +#
>>> +# Invocation Syntax:
>>> +#
>>> +#   start-server [geronimo_args ...]
>>> +#
>>> +# Environment Variable Prequisites:
>>> +#
>>> +#   Refer to the documentation in the gsh file for information
>>> +#   on environment variables etc.
>>> +#
>>> +# --------------------------------------------------------------------
>>> +
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +EXECUTABLE=gsh
>>> +
>>> +# Check that target executable exists
>>> +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
>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>> +    echo "This file is needed to run this program"
>>> +    exit 1
>>> +  fi
>>> +fi
>>>
>>> ARGS=
>>> while [ $# -ge 1 ]; do
>>> @@ -30,5 +84,5 @@
>>>  shift
>>> done
>>>
>>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>>
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -1,37 +1,82 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@rem
>>> +
>>> +@rem 
>>> --------------------------------------------------------------------
>>> +@rem start-server batch file for Geronimo that starts Geronimo in 
>>> foreground.
>>> +@rem
>>> +@rem This batch file calls the gsh.bat script passing 
>>> "geronimo/start-server
>>> +@rem followed by the arguments supplied by the caller.
>>> +@rem
>>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>>> directly.
>>> +@rem
>>> +@rem Invocation Syntax:
>>> +@rem
>>> +@rem   start-server [geronimo_args ...]
>>> +@rem
>>> +@rem Environment Variable Prequisites:
>>> +@rem
>>> +@rem   Refer to the GShell documentation for information on environment
>>> +@rem   variables etc.
>>> +@rem
>>> +@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 command - you are running an unsupported 
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>
>>> -:end
>>> +@REM Check that target executable exists
>>> +if exist "%EXECUTABLE%" goto okExec
>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okExec
>>> +@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
>>>
>>> -if "%OS%"=="Windows_NT" endlocal
>>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>>
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -22,7 +22,61 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> +# --------------------------------------------------------------------
>>> +# Shutdown script for Geronimo that stops Geronimo in the foreground.
>>> +#
>>> +# This script calls the gsh script passing "geronimo/stop-server" as 
>>> the
>>> +# first argument followed by the arguments supplied by the caller.
>>> +#
>>> +# Alternatively you can use the more comprehensive gsh interface 
>>> directly.
>>> +#
>>> +# Invocation Syntax:
>>> +#
>>> +#   stop-server [geronimo_args ...]
>>> +#
>>> +# Environment Variable Prequisites:
>>> +#
>>> +#   Refer to the documentation in the gsh file for information
>>> +#   on environment variables etc.
>>> +#
>>> +# --------------------------------------------------------------------
>>> +
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +EXECUTABLE=gsh
>>> +
>>> +# Check that target executable exists
>>> +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
>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>> +    echo "This file is needed to run this program"
>>> +    exit 1
>>> +  fi
>>> +fi
>>>
>>> ARGS=
>>> while [ $# -ge 1 ]; do
>>> @@ -30,5 +84,5 @@
>>>  shift
>>> done
>>>
>>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>>
>>>
>>> Modified: 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>> (original)
>>> +++ 
>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>> Mon Jun  9 09:00:31 2008
>>> @@ -1,37 +1,82 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@rem
>>> +
>>> +@rem 
>>> --------------------------------------------------------------------
>>> +@rem stop-server batch file for Geronimo that stops Geronimo in 
>>> foreground.
>>> +@rem
>>> +@rem This batch file calls the gsh.bat script passing 
>>> "geronimo/stop-server
>>> +@rem followed by the arguments supplied by the caller.
>>> +@rem
>>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>>> directly.
>>> +@rem
>>> +@rem Invocation Syntax:
>>> +@rem
>>> +@rem   stop-server [geronimo_args ...]
>>> +@rem
>>> +@rem Environment Variable Prequisites:
>>> +@rem
>>> +@rem   Refer to the GShell documentation for information on environment
>>> +@rem   variables etc.
>>> +@rem
>>> +@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 command - you are running an unsupported 
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>
>>> -:end
>>> +@REM Check that target executable exists
>>> +if exist "%EXECUTABLE%" goto okExec
>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okExec
>>> +@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
>>>
>>> -if "%OS%"=="Windows_NT" endlocal
>>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>>
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>>
>>
> 
> 

Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by David Jencks <da...@yahoo.com>.
I am not sure I understand the full content of this change, but I am  
definitely -1 on running any user supplied platform specific scripts  
without a compelling documented use case showing why we can't use  
gshell groovy scripts instead.  We have gshell, lets use it.

thanks
david jencks

On Jun 9, 2008, at 9:11 AM, Jason Dillon wrote:

> Pffff... I really dislike all this crap in the native platform  
> scripts.  Just why is all this junk needed?
>
> What is the os400 muck for?  Why do we care about resolving soft- 
> links?
>
> Why is setjavaenv.sh required?
>
> Ugh... I think this is a mess.
>
> --jason
>
>
> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
>
>> Author: dwoods
>> Date: Mon Jun  9 09:00:31 2008
>> New Revision: 665729
>>
>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>> Log:
>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for  
>> determining the Java runtime, allow users to continue to supply a  
>> setenv script and updated the Unix gsh script with some missing  
>> Cygwin, OS400 and error checking that was in geronimo.sh.
>>
>> Modified:
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh.bat
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server.bat
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server
>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server.bat
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/gsh
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh Mon Jun  9 09:00:31 2008
>> @@ -22,42 +22,90 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>> 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> -
>> # OS specific support (must be 'true' or 'false').
>> cygwin=false
>> +os400=false
>> case "`uname`" in
>> -    CYGWIN*)
>> -        cygwin=true
>> -        ;;
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +
>> +# Locate GSHELL_HOME if not it is not set
>> +if [ "x$GSHELL_HOME" = "x" ]; then
>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>> +fi
>> +
>> +# Execute optional environment  if provided by the user
>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>> +    . "$GSHELL_HOME"/bin/setenv.sh
>> +fi
>> +
>> # For Cygwin, ensure paths are in UNIX format before anything is  
>> touched
>> if $cygwin ; then
>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>> "$GSHELL_HOME"`
>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>> "$GSHELL_HOME"`
>> fi
>>
>> -# Locate GSHELL_HOME if not it is not set
>> -if [ "x$GSHELL_HOME" = "x" ]; then
>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>> +# 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
>>
>> -# Determine the Java command to use to start the JVM
>> -if [ -z "$JAVACMD" ]; then
>> -    if [ -n "$JAVA_HOME" ]; then
>> -        JAVACMD="$JAVA_HOME/bin/java"
>> +# 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="$GSHELL_HOME"
>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>> +else
>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>> +        BASEDIR="$GSHELL_HOME"
>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>    else
>> -        JAVACMD="java"
>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>> +        echo "This file is needed to run this program"
>> +        exit 1
>>    fi
>> 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"`
>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>> +fi
>> +
>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>> if $cygwin ; then
>>    BOOTJAR=`cygpath --windows "$BOOTJAR"`
>> fi
>>
>> # Start the JVM
>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/gsh.bat
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh.bat (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/gsh.bat Mon Jun  9 09:00:31 2008
>> @@ -1,82 +1,86 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>> -set ERRORLEVEL=0
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@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 command - you are running an unsupported  
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -:check_JAVACMD
>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>> -
>> -:check_JAVA_HOME
>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>> -set JAVACMD=java
>> -goto check_GSHELL_HOME
>> -
>> -:have_JAVA_HOME
>> -set JAVACMD=%JAVA_HOME%\bin\java
>> -goto check_GSHELL_HOME
>> +@REM Get standard environment variables
>> +@REM Users can optionally create this file to set environment  
>> variables.
>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>> +if not %errorlevel% == 0 goto end
>> +
>> +@REM Get standard Java environment variables
>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>> +set ERRORLEVEL=1
>> +goto end
>> +:okSetJavaEnv
>> +set BASEDIR=%DIRNAME%
>> +call "%DIRNAME%\setJavaEnv.bat"
>> +if not %errorlevel% == 0 goto end
>>
>> :check_GSHELL_HOME
>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>
>> :init
>> -rem Get command-line arguments, handling Windowz variants
>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>> +rem Get command-line arguments, handling Windows variants
>> if "%eval[2+2]" == "4" goto 4NT_args
>>
>> rem Regular WinNT shell
>> -set ARGS=%*
>> -goto execute
>> -
>> -:win9xME_args
>> -rem Slurp the command line arguments.  This loop allows for an  
>> unlimited number
>> set ARGS=
>> -
>> -:win9xME_args_slurp
>> -if "x%1" == "x" goto execute
>> +:setArgs
>> +if ""%1""=="""" goto doneSetArgs
>> set ARGS=%ARGS% %1
>> shift
>> -goto win9xME_args_slurp
>> +goto setArgs
>> +:doneSetArgs
>> +goto execute
>>
>> :4NT_args
>> rem Get arguments from the 4NT Shell from JP Software
>> set ARGS=%$
>>
>> :execute
>> -
>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>
>> rem Start the JVM
>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>
>> :end
>> -
>> -if "%OS%"=="Windows_NT" endlocal
>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>> -
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/start-server
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server Mon Jun  9 09:00:31 2008
>> @@ -22,7 +22,61 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>> 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> +#  
>> --------------------------------------------------------------------
>> +# Startup script for Geronimo that starts Geronimo in the  
>> foreground.
>> +#
>> +# This script calls the gsh script passing "geronimo/start-server"  
>> as the
>> +# first argument followed by the arguments supplied by the caller.
>> +#
>> +# Alternatively you can use the more comprehensive gsh interface  
>> directly.
>> +#
>> +# Invocation Syntax:
>> +#
>> +#   start-server [geronimo_args ...]
>> +#
>> +# Environment Variable Prequisites:
>> +#
>> +#   Refer to the documentation in the gsh file for information
>> +#   on environment variables etc.
>> +#
>> +#  
>> --------------------------------------------------------------------
>> +
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +EXECUTABLE=gsh
>> +
>> +# Check that target executable exists
>> +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
>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>> +    echo "This file is needed to run this program"
>> +    exit 1
>> +  fi
>> +fi
>>
>> ARGS=
>> while [ $# -ge 1 ]; do
>> @@ -30,5 +84,5 @@
>>  shift
>> done
>>
>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/start-server.bat
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server.bat (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/start-server.bat Mon Jun  9 09:00:31  
>> 2008
>> @@ -1,37 +1,82 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@rem
>> +
>> +@rem  
>> --------------------------------------------------------------------
>> +@rem start-server batch file for Geronimo that starts Geronimo in  
>> foreground.
>> +@rem
>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>> start-server
>> +@rem followed by the arguments supplied by the caller.
>> +@rem
>> +@rem Alternatively you can use the more comprehensive gsh.bat file  
>> directly.
>> +@rem
>> +@rem Invocation Syntax:
>> +@rem
>> +@rem   start-server [geronimo_args ...]
>> +@rem
>> +@rem Environment Variable Prequisites:
>> +@rem
>> +@rem   Refer to the GShell documentation for information on  
>> environment
>> +@rem   variables etc.
>> +@rem
>> +@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 command - you are running an unsupported  
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>
>> -:end
>> +@REM Check that target executable exists
>> +if exist "%EXECUTABLE%" goto okExec
>> +echo ERROR - Cannot find required script %EXECUTABLE%
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okExec
>> +@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
>>
>> -if "%OS%"=="Windows_NT" endlocal
>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/stop-server
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server Mon Jun  9 09:00:31 2008
>> @@ -22,7 +22,61 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>> 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> +#  
>> --------------------------------------------------------------------
>> +# Shutdown script for Geronimo that stops Geronimo in the  
>> foreground.
>> +#
>> +# This script calls the gsh script passing "geronimo/stop-server"  
>> as the
>> +# first argument followed by the arguments supplied by the caller.
>> +#
>> +# Alternatively you can use the more comprehensive gsh interface  
>> directly.
>> +#
>> +# Invocation Syntax:
>> +#
>> +#   stop-server [geronimo_args ...]
>> +#
>> +# Environment Variable Prequisites:
>> +#
>> +#   Refer to the documentation in the gsh file for information
>> +#   on environment variables etc.
>> +#
>> +#  
>> --------------------------------------------------------------------
>> +
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +EXECUTABLE=gsh
>> +
>> +# Check that target executable exists
>> +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
>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>> +    echo "This file is needed to run this program"
>> +    exit 1
>> +  fi
>> +fi
>>
>> ARGS=
>> while [ $# -ge 1 ]; do
>> @@ -30,5 +84,5 @@
>>  shift
>> done
>>
>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>
>>
>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>> boilerplate-minimal/src/main/underlay/bin/stop-server.bat
>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server.bat (original)
>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>> minimal/src/main/underlay/bin/stop-server.bat Mon Jun  9 09:00:31  
>> 2008
>> @@ -1,37 +1,82 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@rem
>> +
>> +@rem  
>> --------------------------------------------------------------------
>> +@rem stop-server batch file for Geronimo that stops Geronimo in  
>> foreground.
>> +@rem
>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>> stop-server
>> +@rem followed by the arguments supplied by the caller.
>> +@rem
>> +@rem Alternatively you can use the more comprehensive gsh.bat file  
>> directly.
>> +@rem
>> +@rem Invocation Syntax:
>> +@rem
>> +@rem   stop-server [geronimo_args ...]
>> +@rem
>> +@rem Environment Variable Prequisites:
>> +@rem
>> +@rem   Refer to the GShell documentation for information on  
>> environment
>> +@rem   variables etc.
>> +@rem
>> +@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 command - you are running an unsupported  
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>
>> -:end
>> +@REM Check that target executable exists
>> +if exist "%EXECUTABLE%" goto okExec
>> +echo ERROR - Cannot find required script %EXECUTABLE%
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okExec
>> +@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
>>
>> -if "%OS%"=="Windows_NT" endlocal
>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>>
>


Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Jason Dillon <ja...@planet57.com>.
Ya, that was kinda one of the main points of gshell, was to reduce  
this per-platform scripting muck.  I would like to see this reduced as  
much as possible.

--jason


On Jun 9, 2008, at 11:48 PM, Donald Woods wrote:

> Only if you move the bits handling spaces/quotes for Windows into  
> gsh.bat, but seems like you'd want to keep it in a separate script  
> to minimize platform specific code in the gsh scripts....
>
>
> -Donald
>
>
> Jason Dillon wrote:
>> Okay, so when startup goes away we can nuke the setjavaenv script  
>> then?  Since you are adding support to other commands due to the  
>> existence of the legacy commands?
>> --jason
>> On Jun 9, 2008, at 11:27 PM, Donald Woods wrote:
>>> Setjavaenv ensures the same JVM is used for all commands and that  
>>> spaces and quotes are properly handled on Windows.  Otherwise, a  
>>> user could use startup which uses setjavaenv (and JRE_HOME) and  
>>> then stop-server which used JAVA_HOME or just _JAVACMD=java.
>>>
>>> The OS400 support was there in the geronimo script, so I pulled  
>>> that support into the gsh script.
>>>
>>> There was some error checking in the prior startup/shutdown  
>>> scripts that was missing, like checking that gsh existed before  
>>> calling it from start-server/stop-server scripts.
>>>
>>> There was some cygwin path conversions missing.
>>>
>>> The GERONIMO_BATCH_ECHO support for Windows was missing from the  
>>> new scripts.
>>>
>>>
>>>
>>>
>>> Jason Dillon wrote:
>>>> Pffff... I really dislike all this crap in the native platform  
>>>> scripts.  Just why is all this junk needed?
>>>> What is the os400 muck for?  Why do we care about resolving soft- 
>>>> links?
>>>> Why is setjavaenv.sh required?
>>>> Ugh... I think this is a mess.
>>>> --jason
>>>> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
>>>>> Author: dwoods
>>>>> Date: Mon Jun  9 09:00:31 2008
>>>>> New Revision: 665729
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>>>>> Log:
>>>>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for  
>>>>> determining the Java runtime, allow users to continue to supply  
>>>>> a setenv script and updated the Unix gsh script with some  
>>>>> missing Cygwin, OS400 and error checking that was in geronimo.sh.
>>>>>
>>>>> Modified:
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh.bat
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server.bat
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server
>>>>>  geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server.bat
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/gsh
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh Mon Jun  9 09:00:31 2008
>>>>> @@ -22,42 +22,90 @@
>>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>>>> 2007) $
>>>>> ##
>>>>>
>>>>> -DIRNAME=`dirname "$0"`
>>>>> -
>>>>> # OS specific support (must be 'true' or 'false').
>>>>> cygwin=false
>>>>> +os400=false
>>>>> case "`uname`" in
>>>>> -    CYGWIN*)
>>>>> -        cygwin=true
>>>>> -        ;;
>>>>> +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
>>>>> +
>>>>> +PRGDIR=`dirname "$PRG"`
>>>>> +
>>>>> +# Locate GSHELL_HOME if not it is not set
>>>>> +if [ "x$GSHELL_HOME" = "x" ]; then
>>>>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>>>>> +fi
>>>>> +
>>>>> +# Execute optional environment  if provided by the user
>>>>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>>>>> +    . "$GSHELL_HOME"/bin/setenv.sh
>>>>> +fi
>>>>> +
>>>>> # For Cygwin, ensure paths are in UNIX format before anything is  
>>>>> touched
>>>>> if $cygwin ; then
>>>>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>>>>> "$GSHELL_HOME"`
>>>>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>>>>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>>>>   [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>>>>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>>>>> "$GSHELL_HOME"`
>>>>> fi
>>>>>
>>>>> -# Locate GSHELL_HOME if not it is not set
>>>>> -if [ "x$GSHELL_HOME" = "x" ]; then
>>>>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>>>>> +# 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
>>>>>
>>>>> -# Determine the Java command to use to start the JVM
>>>>> -if [ -z "$JAVACMD" ]; then
>>>>> -    if [ -n "$JAVA_HOME" ]; then
>>>>> -        JAVACMD="$JAVA_HOME/bin/java"
>>>>> +# 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="$GSHELL_HOME"
>>>>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>>> +else
>>>>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>>>>> +        BASEDIR="$GSHELL_HOME"
>>>>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>>>   else
>>>>> -        JAVACMD="java"
>>>>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>>>>> +        echo "This file is needed to run this program"
>>>>> +        exit 1
>>>>>   fi
>>>>> 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"`
>>>>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>>>>> +fi
>>>>> +
>>>>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>>>>> if $cygwin ; then
>>>>>   BOOTJAR=`cygpath --windows "$BOOTJAR"`
>>>>> fi
>>>>>
>>>>> # Start the JVM
>>>>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>>>
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/gsh.bat
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh.bat (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/gsh.bat Mon Jun  9 09:00:31 2008
>>>>> @@ -1,82 +1,86 @@
>>>>> -@if "%DEBUG%" == "" @echo off
>>>>> -rem
>>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>>> -rem distributed with this work for additional information
>>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>>> -rem to you under the Apache License, Version 2.0 (the
>>>>> -rem "License"); you may not use this file except in compliance
>>>>> -rem with the License.  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,
>>>>> -rem software distributed under the License is distributed on an
>>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> -rem KIND, either express or implied.  See the License for the
>>>>> -rem specific language governing permissions and limitations
>>>>> -rem under the License.
>>>>> -rem
>>>>> -
>>>>> -rem
>>>>> -rem $Rev$ $Date$
>>>>> -rem
>>>>> -
>>>>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>>>>> -set ERRORLEVEL=0
>>>>> -
>>>>> -:begin
>>>>> +@rem
>>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>>> +@rem distributed with this work for additional information
>>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>>> +@rem "License"); you may not use this file except in compliance
>>>>> +@rem with the License.  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,
>>>>> +@rem software distributed under the License is distributed on an
>>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> +@rem KIND, either express or implied.  See the License for the
>>>>> +@rem specific language governing permissions and limitations
>>>>> +@rem under the License.
>>>>> +@rem
>>>>> +
>>>>> +@rem
>>>>> +@rem $Rev$ $Date$
>>>>> +@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 command - you are running an unsupported  
>>>>> operating system.
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +
>>>>> +:okOsCheck
>>>>> +@setlocal enableextensions
>>>>> +@set ERRORLEVEL=0
>>>>>
>>>>> set DIRNAME=%~dp0
>>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>>> +cd /d %DIRNAME%
>>>>>
>>>>> -:check_JAVACMD
>>>>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>>>>> -
>>>>> -:check_JAVA_HOME
>>>>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>>>>> -set JAVACMD=java
>>>>> -goto check_GSHELL_HOME
>>>>> -
>>>>> -:have_JAVA_HOME
>>>>> -set JAVACMD=%JAVA_HOME%\bin\java
>>>>> -goto check_GSHELL_HOME
>>>>> +@REM Get standard environment variables
>>>>> +@REM Users can optionally create this file to set environment  
>>>>> variables.
>>>>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>>>>> +if not %errorlevel% == 0 goto end
>>>>> +
>>>>> +@REM Get standard Java environment variables
>>>>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>>>>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +:okSetJavaEnv
>>>>> +set BASEDIR=%DIRNAME%
>>>>> +call "%DIRNAME%\setJavaEnv.bat"
>>>>> +if not %errorlevel% == 0 goto end
>>>>>
>>>>> :check_GSHELL_HOME
>>>>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>>>>
>>>>> :init
>>>>> -rem Get command-line arguments, handling Windowz variants
>>>>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>>>>> +rem Get command-line arguments, handling Windows variants
>>>>> if "%eval[2+2]" == "4" goto 4NT_args
>>>>>
>>>>> rem Regular WinNT shell
>>>>> -set ARGS=%*
>>>>> -goto execute
>>>>> -
>>>>> -:win9xME_args
>>>>> -rem Slurp the command line arguments.  This loop allows for an  
>>>>> unlimited number
>>>>> set ARGS=
>>>>> -
>>>>> -:win9xME_args_slurp
>>>>> -if "x%1" == "x" goto execute
>>>>> +:setArgs
>>>>> +if ""%1""=="""" goto doneSetArgs
>>>>> set ARGS=%ARGS% %1
>>>>> shift
>>>>> -goto win9xME_args_slurp
>>>>> +goto setArgs
>>>>> +:doneSetArgs
>>>>> +goto execute
>>>>>
>>>>> :4NT_args
>>>>> rem Get arguments from the 4NT Shell from JP Software
>>>>> set ARGS=%$
>>>>>
>>>>> :execute
>>>>> -
>>>>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>>>>
>>>>> rem Start the JVM
>>>>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>>>
>>>>> :end
>>>>> -
>>>>> -if "%OS%"=="Windows_NT" endlocal
>>>>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>>>>> -
>>>>> +:end
>>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>>> +@endlocal
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/start-server
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server Mon Jun  9 09:00:31  
>>>>> 2008
>>>>> @@ -22,7 +22,61 @@
>>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>>>> 2007) $
>>>>> ##
>>>>>
>>>>> -DIRNAME=`dirname "$0"`
>>>>> +#  
>>>>> --------------------------------------------------------------------
>>>>> +# Startup script for Geronimo that starts Geronimo in the  
>>>>> foreground.
>>>>> +#
>>>>> +# This script calls the gsh script passing "geronimo/start- 
>>>>> server" as the
>>>>> +# first argument followed by the arguments supplied by the  
>>>>> caller.
>>>>> +#
>>>>> +# Alternatively you can use the more comprehensive gsh  
>>>>> interface directly.
>>>>> +#
>>>>> +# Invocation Syntax:
>>>>> +#
>>>>> +#   start-server [geronimo_args ...]
>>>>> +#
>>>>> +# Environment Variable Prequisites:
>>>>> +#
>>>>> +#   Refer to the documentation in the gsh file for information
>>>>> +#   on environment variables etc.
>>>>> +#
>>>>> +#  
>>>>> --------------------------------------------------------------------
>>>>> +
>>>>> +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
>>>>> +
>>>>> +PRGDIR=`dirname "$PRG"`
>>>>> +EXECUTABLE=gsh
>>>>> +
>>>>> +# Check that target executable exists
>>>>> +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
>>>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>>>> +    echo "This file is needed to run this program"
>>>>> +    exit 1
>>>>> +  fi
>>>>> +fi
>>>>>
>>>>> ARGS=
>>>>> while [ $# -ge 1 ]; do
>>>>> @@ -30,5 +84,5 @@
>>>>> shift
>>>>> done
>>>>>
>>>>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>>>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>>>>
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/start-server.bat
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server.bat (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/start-server.bat Mon Jun  9  
>>>>> 09:00:31 2008
>>>>> @@ -1,37 +1,82 @@
>>>>> -@if "%DEBUG%" == "" @echo off
>>>>> -rem
>>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>>> -rem distributed with this work for additional information
>>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>>> -rem to you under the Apache License, Version 2.0 (the
>>>>> -rem "License"); you may not use this file except in compliance
>>>>> -rem with the License.  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,
>>>>> -rem software distributed under the License is distributed on an
>>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> -rem KIND, either express or implied.  See the License for the
>>>>> -rem specific language governing permissions and limitations
>>>>> -rem under the License.
>>>>> -rem
>>>>> -
>>>>> -rem
>>>>> -rem $Rev$ $Date$
>>>>> -rem
>>>>> -
>>>>> -if "%OS%"=="Windows_NT" setlocal
>>>>> -
>>>>> -:begin
>>>>> +@rem
>>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>>> +@rem distributed with this work for additional information
>>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>>> +@rem "License"); you may not use this file except in compliance
>>>>> +@rem with the License.  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,
>>>>> +@rem software distributed under the License is distributed on an
>>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> +@rem KIND, either express or implied.  See the License for the
>>>>> +@rem specific language governing permissions and limitations
>>>>> +@rem under the License.
>>>>> +@rem
>>>>> +
>>>>> +@rem
>>>>> +@rem $Rev$ $Date$
>>>>> +@rem
>>>>> +
>>>>> +@rem  
>>>>> --------------------------------------------------------------------
>>>>> +@rem start-server batch file for Geronimo that starts Geronimo  
>>>>> in foreground.
>>>>> +@rem
>>>>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>>>>> start-server
>>>>> +@rem followed by the arguments supplied by the caller.
>>>>> +@rem
>>>>> +@rem Alternatively you can use the more comprehensive gsh.bat  
>>>>> file directly.
>>>>> +@rem
>>>>> +@rem Invocation Syntax:
>>>>> +@rem
>>>>> +@rem   start-server [geronimo_args ...]
>>>>> +@rem
>>>>> +@rem Environment Variable Prequisites:
>>>>> +@rem
>>>>> +@rem   Refer to the GShell documentation for information on  
>>>>> environment
>>>>> +@rem   variables etc.
>>>>> +@rem
>>>>> +@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 command - you are running an unsupported  
>>>>> operating system.
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +
>>>>> +:okOsCheck
>>>>> +@setlocal enableextensions
>>>>> +@set ERRORLEVEL=0
>>>>>
>>>>> set DIRNAME=%~dp0
>>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>>> +cd /d %DIRNAME%
>>>>>
>>>>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>>>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>>>
>>>>> -:end
>>>>> +@REM Check that target executable exists
>>>>> +if exist "%EXECUTABLE%" goto okExec
>>>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +
>>>>> +:okExec
>>>>> +@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
>>>>>
>>>>> -if "%OS%"=="Windows_NT" endlocal
>>>>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>>>>
>>>>> +:end
>>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>>> +@endlocal
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/stop-server
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server Mon Jun  9 09:00:31 2008
>>>>> @@ -22,7 +22,61 @@
>>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>>>> 2007) $
>>>>> ##
>>>>>
>>>>> -DIRNAME=`dirname "$0"`
>>>>> +#  
>>>>> --------------------------------------------------------------------
>>>>> +# Shutdown script for Geronimo that stops Geronimo in the  
>>>>> foreground.
>>>>> +#
>>>>> +# This script calls the gsh script passing "geronimo/stop- 
>>>>> server" as the
>>>>> +# first argument followed by the arguments supplied by the  
>>>>> caller.
>>>>> +#
>>>>> +# Alternatively you can use the more comprehensive gsh  
>>>>> interface directly.
>>>>> +#
>>>>> +# Invocation Syntax:
>>>>> +#
>>>>> +#   stop-server [geronimo_args ...]
>>>>> +#
>>>>> +# Environment Variable Prequisites:
>>>>> +#
>>>>> +#   Refer to the documentation in the gsh file for information
>>>>> +#   on environment variables etc.
>>>>> +#
>>>>> +#  
>>>>> --------------------------------------------------------------------
>>>>> +
>>>>> +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
>>>>> +
>>>>> +PRGDIR=`dirname "$PRG"`
>>>>> +EXECUTABLE=gsh
>>>>> +
>>>>> +# Check that target executable exists
>>>>> +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
>>>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>>>> +    echo "This file is needed to run this program"
>>>>> +    exit 1
>>>>> +  fi
>>>>> +fi
>>>>>
>>>>> ARGS=
>>>>> while [ $# -ge 1 ]; do
>>>>> @@ -30,5 +84,5 @@
>>>>> shift
>>>>> done
>>>>>
>>>>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>>>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>>>>
>>>>>
>>>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>>>> boilerplate-minimal/src/main/underlay/bin/stop-server.bat
>>>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> = 
>>>>> ==================================================================
>>>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server.bat (original)
>>>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>>>> minimal/src/main/underlay/bin/stop-server.bat Mon Jun  9  
>>>>> 09:00:31 2008
>>>>> @@ -1,37 +1,82 @@
>>>>> -@if "%DEBUG%" == "" @echo off
>>>>> -rem
>>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>>> -rem distributed with this work for additional information
>>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>>> -rem to you under the Apache License, Version 2.0 (the
>>>>> -rem "License"); you may not use this file except in compliance
>>>>> -rem with the License.  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,
>>>>> -rem software distributed under the License is distributed on an
>>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> -rem KIND, either express or implied.  See the License for the
>>>>> -rem specific language governing permissions and limitations
>>>>> -rem under the License.
>>>>> -rem
>>>>> -
>>>>> -rem
>>>>> -rem $Rev$ $Date$
>>>>> -rem
>>>>> -
>>>>> -if "%OS%"=="Windows_NT" setlocal
>>>>> -
>>>>> -:begin
>>>>> +@rem
>>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>>> +@rem distributed with this work for additional information
>>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>>> +@rem "License"); you may not use this file except in compliance
>>>>> +@rem with the License.  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,
>>>>> +@rem software distributed under the License is distributed on an
>>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>>> +@rem KIND, either express or implied.  See the License for the
>>>>> +@rem specific language governing permissions and limitations
>>>>> +@rem under the License.
>>>>> +@rem
>>>>> +
>>>>> +@rem
>>>>> +@rem $Rev$ $Date$
>>>>> +@rem
>>>>> +
>>>>> +@rem  
>>>>> --------------------------------------------------------------------
>>>>> +@rem stop-server batch file for Geronimo that stops Geronimo in  
>>>>> foreground.
>>>>> +@rem
>>>>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>>>>> stop-server
>>>>> +@rem followed by the arguments supplied by the caller.
>>>>> +@rem
>>>>> +@rem Alternatively you can use the more comprehensive gsh.bat  
>>>>> file directly.
>>>>> +@rem
>>>>> +@rem Invocation Syntax:
>>>>> +@rem
>>>>> +@rem   stop-server [geronimo_args ...]
>>>>> +@rem
>>>>> +@rem Environment Variable Prequisites:
>>>>> +@rem
>>>>> +@rem   Refer to the GShell documentation for information on  
>>>>> environment
>>>>> +@rem   variables etc.
>>>>> +@rem
>>>>> +@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 command - you are running an unsupported  
>>>>> operating system.
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +
>>>>> +:okOsCheck
>>>>> +@setlocal enableextensions
>>>>> +@set ERRORLEVEL=0
>>>>>
>>>>> set DIRNAME=%~dp0
>>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>>> +cd /d %DIRNAME%
>>>>>
>>>>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>>>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>>>
>>>>> -:end
>>>>> +@REM Check that target executable exists
>>>>> +if exist "%EXECUTABLE%" goto okExec
>>>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>>>> +set ERRORLEVEL=1
>>>>> +goto end
>>>>> +
>>>>> +:okExec
>>>>> +@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
>>>>>
>>>>> -if "%OS%"=="Windows_NT" endlocal
>>>>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>>>>
>>>>> +:end
>>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>>> +@endlocal
>>>>>
>>>>>


Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Donald Woods <dw...@apache.org>.
Only if you move the bits handling spaces/quotes for Windows into 
gsh.bat, but seems like you'd want to keep it in a separate script to 
minimize platform specific code in the gsh scripts....


-Donald


Jason Dillon wrote:
> Okay, so when startup goes away we can nuke the setjavaenv script then?  
> Since you are adding support to other commands due to the existence of 
> the legacy commands?
> 
> --jason
> 
> 
> On Jun 9, 2008, at 11:27 PM, Donald Woods wrote:
> 
>> Setjavaenv ensures the same JVM is used for all commands and that 
>> spaces and quotes are properly handled on Windows.  Otherwise, a user 
>> could use startup which uses setjavaenv (and JRE_HOME) and then 
>> stop-server which used JAVA_HOME or just _JAVACMD=java.
>>
>> The OS400 support was there in the geronimo script, so I pulled that 
>> support into the gsh script.
>>
>> There was some error checking in the prior startup/shutdown scripts 
>> that was missing, like checking that gsh existed before calling it 
>> from start-server/stop-server scripts.
>>
>> There was some cygwin path conversions missing.
>>
>> The GERONIMO_BATCH_ECHO support for Windows was missing from the new 
>> scripts.
>>
>>
>>
>>
>> Jason Dillon wrote:
>>> Pffff... I really dislike all this crap in the native platform 
>>> scripts.  Just why is all this junk needed?
>>> What is the os400 muck for?  Why do we care about resolving soft-links?
>>> Why is setjavaenv.sh required?
>>> Ugh... I think this is a mess.
>>> --jason
>>> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
>>>> Author: dwoods
>>>> Date: Mon Jun  9 09:00:31 2008
>>>> New Revision: 665729
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>>>> Log:
>>>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for 
>>>> determining the Java runtime, allow users to continue to supply a 
>>>> setenv script and updated the Unix gsh script with some missing 
>>>> Cygwin, OS400 and error checking that was in geronimo.sh.
>>>>
>>>> Modified:
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>>
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>>
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>>
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>>
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>>
>>>>   
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>>
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -22,42 +22,90 @@
>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>>> ##
>>>>
>>>> -DIRNAME=`dirname "$0"`
>>>> -
>>>> # OS specific support (must be 'true' or 'false').
>>>> cygwin=false
>>>> +os400=false
>>>> case "`uname`" in
>>>> -    CYGWIN*)
>>>> -        cygwin=true
>>>> -        ;;
>>>> +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
>>>> +
>>>> +PRGDIR=`dirname "$PRG"`
>>>> +
>>>> +# Locate GSHELL_HOME if not it is not set
>>>> +if [ "x$GSHELL_HOME" = "x" ]; then
>>>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>>>> +fi
>>>> +
>>>> +# Execute optional environment  if provided by the user
>>>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>>>> +    . "$GSHELL_HOME"/bin/setenv.sh
>>>> +fi
>>>> +
>>>> # For Cygwin, ensure paths are in UNIX format before anything is 
>>>> touched
>>>> if $cygwin ; then
>>>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix 
>>>> "$GSHELL_HOME"`
>>>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>>>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>>>    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>>>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix 
>>>> "$GSHELL_HOME"`
>>>> fi
>>>>
>>>> -# Locate GSHELL_HOME if not it is not set
>>>> -if [ "x$GSHELL_HOME" = "x" ]; then
>>>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>>>> +# 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
>>>>
>>>> -# Determine the Java command to use to start the JVM
>>>> -if [ -z "$JAVACMD" ]; then
>>>> -    if [ -n "$JAVA_HOME" ]; then
>>>> -        JAVACMD="$JAVA_HOME/bin/java"
>>>> +# 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="$GSHELL_HOME"
>>>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>> +else
>>>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>>>> +        BASEDIR="$GSHELL_HOME"
>>>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>>    else
>>>> -        JAVACMD="java"
>>>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>>>> +        echo "This file is needed to run this program"
>>>> +        exit 1
>>>>    fi
>>>> 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"`
>>>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>>>> +fi
>>>> +
>>>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>>>> if $cygwin ; then
>>>>    BOOTJAR=`cygpath --windows "$BOOTJAR"`
>>>> fi
>>>>
>>>> # Start the JVM
>>>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>>
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -1,82 +1,86 @@
>>>> -@if "%DEBUG%" == "" @echo off
>>>> -rem
>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>> -rem distributed with this work for additional information
>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>> -rem to you under the Apache License, Version 2.0 (the
>>>> -rem "License"); you may not use this file except in compliance
>>>> -rem with the License.  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,
>>>> -rem software distributed under the License is distributed on an
>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> -rem KIND, either express or implied.  See the License for the
>>>> -rem specific language governing permissions and limitations
>>>> -rem under the License.
>>>> -rem
>>>> -
>>>> -rem
>>>> -rem $Rev$ $Date$
>>>> -rem
>>>> -
>>>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>>>> -set ERRORLEVEL=0
>>>> -
>>>> -:begin
>>>> +@rem
>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>> +@rem distributed with this work for additional information
>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>> +@rem "License"); you may not use this file except in compliance
>>>> +@rem with the License.  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,
>>>> +@rem software distributed under the License is distributed on an
>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> +@rem KIND, either express or implied.  See the License for the
>>>> +@rem specific language governing permissions and limitations
>>>> +@rem under the License.
>>>> +@rem
>>>> +
>>>> +@rem
>>>> +@rem $Rev$ $Date$
>>>> +@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 command - you are running an unsupported 
>>>> operating system.
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +
>>>> +:okOsCheck
>>>> +@setlocal enableextensions
>>>> +@set ERRORLEVEL=0
>>>>
>>>> set DIRNAME=%~dp0
>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>> +cd /d %DIRNAME%
>>>>
>>>> -:check_JAVACMD
>>>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>>>> -
>>>> -:check_JAVA_HOME
>>>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>>>> -set JAVACMD=java
>>>> -goto check_GSHELL_HOME
>>>> -
>>>> -:have_JAVA_HOME
>>>> -set JAVACMD=%JAVA_HOME%\bin\java
>>>> -goto check_GSHELL_HOME
>>>> +@REM Get standard environment variables
>>>> +@REM Users can optionally create this file to set environment 
>>>> variables.
>>>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>>>> +if not %errorlevel% == 0 goto end
>>>> +
>>>> +@REM Get standard Java environment variables
>>>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>>>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +:okSetJavaEnv
>>>> +set BASEDIR=%DIRNAME%
>>>> +call "%DIRNAME%\setJavaEnv.bat"
>>>> +if not %errorlevel% == 0 goto end
>>>>
>>>> :check_GSHELL_HOME
>>>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>>>
>>>> :init
>>>> -rem Get command-line arguments, handling Windowz variants
>>>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>>>> +rem Get command-line arguments, handling Windows variants
>>>> if "%eval[2+2]" == "4" goto 4NT_args
>>>>
>>>> rem Regular WinNT shell
>>>> -set ARGS=%*
>>>> -goto execute
>>>> -
>>>> -:win9xME_args
>>>> -rem Slurp the command line arguments.  This loop allows for an 
>>>> unlimited number
>>>> set ARGS=
>>>> -
>>>> -:win9xME_args_slurp
>>>> -if "x%1" == "x" goto execute
>>>> +:setArgs
>>>> +if ""%1""=="""" goto doneSetArgs
>>>> set ARGS=%ARGS% %1
>>>> shift
>>>> -goto win9xME_args_slurp
>>>> +goto setArgs
>>>> +:doneSetArgs
>>>> +goto execute
>>>>
>>>> :4NT_args
>>>> rem Get arguments from the 4NT Shell from JP Software
>>>> set ARGS=%$
>>>>
>>>> :execute
>>>> -
>>>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>>>
>>>> rem Start the JVM
>>>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>>
>>>> :end
>>>> -
>>>> -if "%OS%"=="Windows_NT" endlocal
>>>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>>>> -
>>>> +:end
>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>> +@endlocal
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -22,7 +22,61 @@
>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>>> ##
>>>>
>>>> -DIRNAME=`dirname "$0"`
>>>> +# --------------------------------------------------------------------
>>>> +# Startup script for Geronimo that starts Geronimo in the foreground.
>>>> +#
>>>> +# This script calls the gsh script passing "geronimo/start-server" 
>>>> as the
>>>> +# first argument followed by the arguments supplied by the caller.
>>>> +#
>>>> +# Alternatively you can use the more comprehensive gsh interface 
>>>> directly.
>>>> +#
>>>> +# Invocation Syntax:
>>>> +#
>>>> +#   start-server [geronimo_args ...]
>>>> +#
>>>> +# Environment Variable Prequisites:
>>>> +#
>>>> +#   Refer to the documentation in the gsh file for information
>>>> +#   on environment variables etc.
>>>> +#
>>>> +# --------------------------------------------------------------------
>>>> +
>>>> +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
>>>> +
>>>> +PRGDIR=`dirname "$PRG"`
>>>> +EXECUTABLE=gsh
>>>> +
>>>> +# Check that target executable exists
>>>> +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
>>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>>> +    echo "This file is needed to run this program"
>>>> +    exit 1
>>>> +  fi
>>>> +fi
>>>>
>>>> ARGS=
>>>> while [ $# -ge 1 ]; do
>>>> @@ -30,5 +84,5 @@
>>>>  shift
>>>> done
>>>>
>>>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>>>
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -1,37 +1,82 @@
>>>> -@if "%DEBUG%" == "" @echo off
>>>> -rem
>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>> -rem distributed with this work for additional information
>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>> -rem to you under the Apache License, Version 2.0 (the
>>>> -rem "License"); you may not use this file except in compliance
>>>> -rem with the License.  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,
>>>> -rem software distributed under the License is distributed on an
>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> -rem KIND, either express or implied.  See the License for the
>>>> -rem specific language governing permissions and limitations
>>>> -rem under the License.
>>>> -rem
>>>> -
>>>> -rem
>>>> -rem $Rev$ $Date$
>>>> -rem
>>>> -
>>>> -if "%OS%"=="Windows_NT" setlocal
>>>> -
>>>> -:begin
>>>> +@rem
>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>> +@rem distributed with this work for additional information
>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>> +@rem "License"); you may not use this file except in compliance
>>>> +@rem with the License.  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,
>>>> +@rem software distributed under the License is distributed on an
>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> +@rem KIND, either express or implied.  See the License for the
>>>> +@rem specific language governing permissions and limitations
>>>> +@rem under the License.
>>>> +@rem
>>>> +
>>>> +@rem
>>>> +@rem $Rev$ $Date$
>>>> +@rem
>>>> +
>>>> +@rem 
>>>> --------------------------------------------------------------------
>>>> +@rem start-server batch file for Geronimo that starts Geronimo in 
>>>> foreground.
>>>> +@rem
>>>> +@rem This batch file calls the gsh.bat script passing 
>>>> "geronimo/start-server
>>>> +@rem followed by the arguments supplied by the caller.
>>>> +@rem
>>>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>>>> directly.
>>>> +@rem
>>>> +@rem Invocation Syntax:
>>>> +@rem
>>>> +@rem   start-server [geronimo_args ...]
>>>> +@rem
>>>> +@rem Environment Variable Prequisites:
>>>> +@rem
>>>> +@rem   Refer to the GShell documentation for information on 
>>>> environment
>>>> +@rem   variables etc.
>>>> +@rem
>>>> +@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 command - you are running an unsupported 
>>>> operating system.
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +
>>>> +:okOsCheck
>>>> +@setlocal enableextensions
>>>> +@set ERRORLEVEL=0
>>>>
>>>> set DIRNAME=%~dp0
>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>> +cd /d %DIRNAME%
>>>>
>>>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>>
>>>> -:end
>>>> +@REM Check that target executable exists
>>>> +if exist "%EXECUTABLE%" goto okExec
>>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +
>>>> +:okExec
>>>> +@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
>>>>
>>>> -if "%OS%"=="Windows_NT" endlocal
>>>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>>>
>>>> +:end
>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>> +@endlocal
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -22,7 +22,61 @@
>>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>>>> ##
>>>>
>>>> -DIRNAME=`dirname "$0"`
>>>> +# --------------------------------------------------------------------
>>>> +# Shutdown script for Geronimo that stops Geronimo in the foreground.
>>>> +#
>>>> +# This script calls the gsh script passing "geronimo/stop-server" 
>>>> as the
>>>> +# first argument followed by the arguments supplied by the caller.
>>>> +#
>>>> +# Alternatively you can use the more comprehensive gsh interface 
>>>> directly.
>>>> +#
>>>> +# Invocation Syntax:
>>>> +#
>>>> +#   stop-server [geronimo_args ...]
>>>> +#
>>>> +# Environment Variable Prequisites:
>>>> +#
>>>> +#   Refer to the documentation in the gsh file for information
>>>> +#   on environment variables etc.
>>>> +#
>>>> +# --------------------------------------------------------------------
>>>> +
>>>> +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
>>>> +
>>>> +PRGDIR=`dirname "$PRG"`
>>>> +EXECUTABLE=gsh
>>>> +
>>>> +# Check that target executable exists
>>>> +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
>>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>>> +    echo "This file is needed to run this program"
>>>> +    exit 1
>>>> +  fi
>>>> +fi
>>>>
>>>> ARGS=
>>>> while [ $# -ge 1 ]; do
>>>> @@ -30,5 +84,5 @@
>>>>  shift
>>>> done
>>>>
>>>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>>>
>>>>
>>>> Modified: 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>>
>>>> URL: 
>>>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>>>
>>>> ============================================================================== 
>>>>
>>>> --- 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>> (original)
>>>> +++ 
>>>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>>> Mon Jun  9 09:00:31 2008
>>>> @@ -1,37 +1,82 @@
>>>> -@if "%DEBUG%" == "" @echo off
>>>> -rem
>>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>>> -rem or more contributor license agreements.  See the NOTICE file
>>>> -rem distributed with this work for additional information
>>>> -rem regarding copyright ownership.  The ASF licenses this file
>>>> -rem to you under the Apache License, Version 2.0 (the
>>>> -rem "License"); you may not use this file except in compliance
>>>> -rem with the License.  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,
>>>> -rem software distributed under the License is distributed on an
>>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> -rem KIND, either express or implied.  See the License for the
>>>> -rem specific language governing permissions and limitations
>>>> -rem under the License.
>>>> -rem
>>>> -
>>>> -rem
>>>> -rem $Rev$ $Date$
>>>> -rem
>>>> -
>>>> -if "%OS%"=="Windows_NT" setlocal
>>>> -
>>>> -:begin
>>>> +@rem
>>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>>> +@rem or more contributor license agreements.  See the NOTICE file
>>>> +@rem distributed with this work for additional information
>>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>>> +@rem to you under the Apache License, Version 2.0 (the
>>>> +@rem "License"); you may not use this file except in compliance
>>>> +@rem with the License.  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,
>>>> +@rem software distributed under the License is distributed on an
>>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>>> +@rem KIND, either express or implied.  See the License for the
>>>> +@rem specific language governing permissions and limitations
>>>> +@rem under the License.
>>>> +@rem
>>>> +
>>>> +@rem
>>>> +@rem $Rev$ $Date$
>>>> +@rem
>>>> +
>>>> +@rem 
>>>> --------------------------------------------------------------------
>>>> +@rem stop-server batch file for Geronimo that stops Geronimo in 
>>>> foreground.
>>>> +@rem
>>>> +@rem This batch file calls the gsh.bat script passing 
>>>> "geronimo/stop-server
>>>> +@rem followed by the arguments supplied by the caller.
>>>> +@rem
>>>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>>>> directly.
>>>> +@rem
>>>> +@rem Invocation Syntax:
>>>> +@rem
>>>> +@rem   stop-server [geronimo_args ...]
>>>> +@rem
>>>> +@rem Environment Variable Prequisites:
>>>> +@rem
>>>> +@rem   Refer to the GShell documentation for information on 
>>>> environment
>>>> +@rem   variables etc.
>>>> +@rem
>>>> +@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 command - you are running an unsupported 
>>>> operating system.
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +
>>>> +:okOsCheck
>>>> +@setlocal enableextensions
>>>> +@set ERRORLEVEL=0
>>>>
>>>> set DIRNAME=%~dp0
>>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>>> +cd /d %DIRNAME%
>>>>
>>>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>>
>>>> -:end
>>>> +@REM Check that target executable exists
>>>> +if exist "%EXECUTABLE%" goto okExec
>>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>>> +set ERRORLEVEL=1
>>>> +goto end
>>>> +
>>>> +:okExec
>>>> +@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
>>>>
>>>> -if "%OS%"=="Windows_NT" endlocal
>>>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>>>
>>>> +:end
>>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>>> +@endlocal
>>>>
>>>>
> 
> 

Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Jason Dillon <ja...@planet57.com>.
Okay, so when startup goes away we can nuke the setjavaenv script  
then?  Since you are adding support to other commands due to the  
existence of the legacy commands?

--jason


On Jun 9, 2008, at 11:27 PM, Donald Woods wrote:

> Setjavaenv ensures the same JVM is used for all commands and that  
> spaces and quotes are properly handled on Windows.  Otherwise, a  
> user could use startup which uses setjavaenv (and JRE_HOME) and then  
> stop-server which used JAVA_HOME or just _JAVACMD=java.
>
> The OS400 support was there in the geronimo script, so I pulled that  
> support into the gsh script.
>
> There was some error checking in the prior startup/shutdown scripts  
> that was missing, like checking that gsh existed before calling it  
> from start-server/stop-server scripts.
>
> There was some cygwin path conversions missing.
>
> The GERONIMO_BATCH_ECHO support for Windows was missing from the new  
> scripts.
>
>
>
>
> Jason Dillon wrote:
>> Pffff... I really dislike all this crap in the native platform  
>> scripts.  Just why is all this junk needed?
>> What is the os400 muck for?  Why do we care about resolving soft- 
>> links?
>> Why is setjavaenv.sh required?
>> Ugh... I think this is a mess.
>> --jason
>> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
>>> Author: dwoods
>>> Date: Mon Jun  9 09:00:31 2008
>>> New Revision: 665729
>>>
>>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>>> Log:
>>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for  
>>> determining the Java runtime, allow users to continue to supply a  
>>> setenv script and updated the Unix gsh script with some missing  
>>> Cygwin, OS400 and error checking that was in geronimo.sh.
>>>
>>> Modified:
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh.bat
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server.bat
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server
>>>   geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server.bat
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/gsh
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh Mon Jun  9 09:00:31 2008
>>> @@ -22,42 +22,90 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>> 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> -
>>> # OS specific support (must be 'true' or 'false').
>>> cygwin=false
>>> +os400=false
>>> case "`uname`" in
>>> -    CYGWIN*)
>>> -        cygwin=true
>>> -        ;;
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +
>>> +# Locate GSHELL_HOME if not it is not set
>>> +if [ "x$GSHELL_HOME" = "x" ]; then
>>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>>> +fi
>>> +
>>> +# Execute optional environment  if provided by the user
>>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>>> +    . "$GSHELL_HOME"/bin/setenv.sh
>>> +fi
>>> +
>>> # For Cygwin, ensure paths are in UNIX format before anything is  
>>> touched
>>> if $cygwin ; then
>>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>>> "$GSHELL_HOME"`
>>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>>    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
>>> "$GSHELL_HOME"`
>>> fi
>>>
>>> -# Locate GSHELL_HOME if not it is not set
>>> -if [ "x$GSHELL_HOME" = "x" ]; then
>>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>>> +# 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
>>>
>>> -# Determine the Java command to use to start the JVM
>>> -if [ -z "$JAVACMD" ]; then
>>> -    if [ -n "$JAVA_HOME" ]; then
>>> -        JAVACMD="$JAVA_HOME/bin/java"
>>> +# 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="$GSHELL_HOME"
>>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>>> +else
>>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>>> +        BASEDIR="$GSHELL_HOME"
>>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>>    else
>>> -        JAVACMD="java"
>>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>>> +        echo "This file is needed to run this program"
>>> +        exit 1
>>>    fi
>>> 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"`
>>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>>> +fi
>>> +
>>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>>> if $cygwin ; then
>>>    BOOTJAR=`cygpath --windows "$BOOTJAR"`
>>> fi
>>>
>>> # Start the JVM
>>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>>
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/gsh.bat
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh.bat (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/gsh.bat Mon Jun  9 09:00:31 2008
>>> @@ -1,82 +1,86 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>>> -set ERRORLEVEL=0
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@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 command - you are running an unsupported  
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -:check_JAVACMD
>>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>>> -
>>> -:check_JAVA_HOME
>>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>>> -set JAVACMD=java
>>> -goto check_GSHELL_HOME
>>> -
>>> -:have_JAVA_HOME
>>> -set JAVACMD=%JAVA_HOME%\bin\java
>>> -goto check_GSHELL_HOME
>>> +@REM Get standard environment variables
>>> +@REM Users can optionally create this file to set environment  
>>> variables.
>>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>>> +if not %errorlevel% == 0 goto end
>>> +
>>> +@REM Get standard Java environment variables
>>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +:okSetJavaEnv
>>> +set BASEDIR=%DIRNAME%
>>> +call "%DIRNAME%\setJavaEnv.bat"
>>> +if not %errorlevel% == 0 goto end
>>>
>>> :check_GSHELL_HOME
>>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>>
>>> :init
>>> -rem Get command-line arguments, handling Windowz variants
>>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>>> +rem Get command-line arguments, handling Windows variants
>>> if "%eval[2+2]" == "4" goto 4NT_args
>>>
>>> rem Regular WinNT shell
>>> -set ARGS=%*
>>> -goto execute
>>> -
>>> -:win9xME_args
>>> -rem Slurp the command line arguments.  This loop allows for an  
>>> unlimited number
>>> set ARGS=
>>> -
>>> -:win9xME_args_slurp
>>> -if "x%1" == "x" goto execute
>>> +:setArgs
>>> +if ""%1""=="""" goto doneSetArgs
>>> set ARGS=%ARGS% %1
>>> shift
>>> -goto win9xME_args_slurp
>>> +goto setArgs
>>> +:doneSetArgs
>>> +goto execute
>>>
>>> :4NT_args
>>> rem Get arguments from the 4NT Shell from JP Software
>>> set ARGS=%$
>>>
>>> :execute
>>> -
>>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>>
>>> rem Start the JVM
>>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>>
>>> :end
>>> -
>>> -if "%OS%"=="Windows_NT" endlocal
>>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>>> -
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/start-server
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server Mon Jun  9 09:00:31 2008
>>> @@ -22,7 +22,61 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>> 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> +#  
>>> --------------------------------------------------------------------
>>> +# Startup script for Geronimo that starts Geronimo in the  
>>> foreground.
>>> +#
>>> +# This script calls the gsh script passing "geronimo/start- 
>>> server" as the
>>> +# first argument followed by the arguments supplied by the caller.
>>> +#
>>> +# Alternatively you can use the more comprehensive gsh interface  
>>> directly.
>>> +#
>>> +# Invocation Syntax:
>>> +#
>>> +#   start-server [geronimo_args ...]
>>> +#
>>> +# Environment Variable Prequisites:
>>> +#
>>> +#   Refer to the documentation in the gsh file for information
>>> +#   on environment variables etc.
>>> +#
>>> +#  
>>> --------------------------------------------------------------------
>>> +
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +EXECUTABLE=gsh
>>> +
>>> +# Check that target executable exists
>>> +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
>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>> +    echo "This file is needed to run this program"
>>> +    exit 1
>>> +  fi
>>> +fi
>>>
>>> ARGS=
>>> while [ $# -ge 1 ]; do
>>> @@ -30,5 +84,5 @@
>>>  shift
>>> done
>>>
>>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>>
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/start-server.bat
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server.bat (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/start-server.bat Mon Jun  9 09:00:31  
>>> 2008
>>> @@ -1,37 +1,82 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@rem
>>> +
>>> +@rem  
>>> --------------------------------------------------------------------
>>> +@rem start-server batch file for Geronimo that starts Geronimo in  
>>> foreground.
>>> +@rem
>>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>>> start-server
>>> +@rem followed by the arguments supplied by the caller.
>>> +@rem
>>> +@rem Alternatively you can use the more comprehensive gsh.bat  
>>> file directly.
>>> +@rem
>>> +@rem Invocation Syntax:
>>> +@rem
>>> +@rem   start-server [geronimo_args ...]
>>> +@rem
>>> +@rem Environment Variable Prequisites:
>>> +@rem
>>> +@rem   Refer to the GShell documentation for information on  
>>> environment
>>> +@rem   variables etc.
>>> +@rem
>>> +@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 command - you are running an unsupported  
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>
>>> -:end
>>> +@REM Check that target executable exists
>>> +if exist "%EXECUTABLE%" goto okExec
>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okExec
>>> +@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
>>>
>>> -if "%OS%"=="Windows_NT" endlocal
>>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>>
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/stop-server
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server Mon Jun  9 09:00:31 2008
>>> @@ -22,7 +22,61 @@
>>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
>>> 2007) $
>>> ##
>>>
>>> -DIRNAME=`dirname "$0"`
>>> +#  
>>> --------------------------------------------------------------------
>>> +# Shutdown script for Geronimo that stops Geronimo in the  
>>> foreground.
>>> +#
>>> +# This script calls the gsh script passing "geronimo/stop-server"  
>>> as the
>>> +# first argument followed by the arguments supplied by the caller.
>>> +#
>>> +# Alternatively you can use the more comprehensive gsh interface  
>>> directly.
>>> +#
>>> +# Invocation Syntax:
>>> +#
>>> +#   stop-server [geronimo_args ...]
>>> +#
>>> +# Environment Variable Prequisites:
>>> +#
>>> +#   Refer to the documentation in the gsh file for information
>>> +#   on environment variables etc.
>>> +#
>>> +#  
>>> --------------------------------------------------------------------
>>> +
>>> +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
>>> +
>>> +PRGDIR=`dirname "$PRG"`
>>> +EXECUTABLE=gsh
>>> +
>>> +# Check that target executable exists
>>> +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
>>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>>> +    echo "This file is needed to run this program"
>>> +    exit 1
>>> +  fi
>>> +fi
>>>
>>> ARGS=
>>> while [ $# -ge 1 ]; do
>>> @@ -30,5 +84,5 @@
>>>  shift
>>> done
>>>
>>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>>
>>>
>>> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
>>> boilerplate-minimal/src/main/underlay/bin/stop-server.bat
>>> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server.bat (original)
>>> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
>>> minimal/src/main/underlay/bin/stop-server.bat Mon Jun  9 09:00:31  
>>> 2008
>>> @@ -1,37 +1,82 @@
>>> -@if "%DEBUG%" == "" @echo off
>>> -rem
>>> -rem Licensed to the Apache Software Foundation (ASF) under one
>>> -rem or more contributor license agreements.  See the NOTICE file
>>> -rem distributed with this work for additional information
>>> -rem regarding copyright ownership.  The ASF licenses this file
>>> -rem to you under the Apache License, Version 2.0 (the
>>> -rem "License"); you may not use this file except in compliance
>>> -rem with the License.  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,
>>> -rem software distributed under the License is distributed on an
>>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> -rem KIND, either express or implied.  See the License for the
>>> -rem specific language governing permissions and limitations
>>> -rem under the License.
>>> -rem
>>> -
>>> -rem
>>> -rem $Rev$ $Date$
>>> -rem
>>> -
>>> -if "%OS%"=="Windows_NT" setlocal
>>> -
>>> -:begin
>>> +@rem
>>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>>> +@rem or more contributor license agreements.  See the NOTICE file
>>> +@rem distributed with this work for additional information
>>> +@rem regarding copyright ownership.  The ASF licenses this file
>>> +@rem to you under the Apache License, Version 2.0 (the
>>> +@rem "License"); you may not use this file except in compliance
>>> +@rem with the License.  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,
>>> +@rem software distributed under the License is distributed on an
>>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>>> +@rem KIND, either express or implied.  See the License for the
>>> +@rem specific language governing permissions and limitations
>>> +@rem under the License.
>>> +@rem
>>> +
>>> +@rem
>>> +@rem $Rev$ $Date$
>>> +@rem
>>> +
>>> +@rem  
>>> --------------------------------------------------------------------
>>> +@rem stop-server batch file for Geronimo that stops Geronimo in  
>>> foreground.
>>> +@rem
>>> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
>>> stop-server
>>> +@rem followed by the arguments supplied by the caller.
>>> +@rem
>>> +@rem Alternatively you can use the more comprehensive gsh.bat  
>>> file directly.
>>> +@rem
>>> +@rem Invocation Syntax:
>>> +@rem
>>> +@rem   stop-server [geronimo_args ...]
>>> +@rem
>>> +@rem Environment Variable Prequisites:
>>> +@rem
>>> +@rem   Refer to the GShell documentation for information on  
>>> environment
>>> +@rem   variables etc.
>>> +@rem
>>> +@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 command - you are running an unsupported  
>>> operating system.
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okOsCheck
>>> +@setlocal enableextensions
>>> +@set ERRORLEVEL=0
>>>
>>> set DIRNAME=%~dp0
>>> if "%DIRNAME%" == "" set DIRNAME=.\
>>> +cd /d %DIRNAME%
>>>
>>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>>
>>> -:end
>>> +@REM Check that target executable exists
>>> +if exist "%EXECUTABLE%" goto okExec
>>> +echo ERROR - Cannot find required script %EXECUTABLE%
>>> +set ERRORLEVEL=1
>>> +goto end
>>> +
>>> +:okExec
>>> +@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
>>>
>>> -if "%OS%"=="Windows_NT" endlocal
>>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>>
>>> +:end
>>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>>> +@endlocal
>>>
>>>


Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Donald Woods <dw...@apache.org>.
Setjavaenv ensures the same JVM is used for all commands and that spaces 
and quotes are properly handled on Windows.  Otherwise, a user could use 
startup which uses setjavaenv (and JRE_HOME) and then stop-server which 
used JAVA_HOME or just _JAVACMD=java.

The OS400 support was there in the geronimo script, so I pulled that 
support into the gsh script.

There was some error checking in the prior startup/shutdown scripts that 
was missing, like checking that gsh existed before calling it from 
start-server/stop-server scripts.

There was some cygwin path conversions missing.

The GERONIMO_BATCH_ECHO support for Windows was missing from the new 
scripts.




Jason Dillon wrote:
> Pffff... I really dislike all this crap in the native platform scripts.  
> Just why is all this junk needed?
> 
> What is the os400 muck for?  Why do we care about resolving soft-links?
> 
> Why is setjavaenv.sh required?
> 
> Ugh... I think this is a mess.
> 
> --jason
> 
> 
> On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:
> 
>> Author: dwoods
>> Date: Mon Jun  9 09:00:31 2008
>> New Revision: 665729
>>
>> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
>> Log:
>> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for 
>> determining the Java runtime, allow users to continue to supply a 
>> setenv script and updated the Unix gsh script with some missing 
>> Cygwin, OS400 and error checking that was in geronimo.sh.
>>
>> Modified:
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>
>>    
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh 
>> Mon Jun  9 09:00:31 2008
>> @@ -22,42 +22,90 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> -
>> # OS specific support (must be 'true' or 'false').
>> cygwin=false
>> +os400=false
>> case "`uname`" in
>> -    CYGWIN*)
>> -        cygwin=true
>> -        ;;
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +
>> +# Locate GSHELL_HOME if not it is not set
>> +if [ "x$GSHELL_HOME" = "x" ]; then
>> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
>> +fi
>> +
>> +# Execute optional environment  if provided by the user
>> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
>> +    . "$GSHELL_HOME"/bin/setenv.sh
>> +fi
>> +
>> # For Cygwin, ensure paths are in UNIX format before anything is touched
>> if $cygwin ; then
>> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix "$GSHELL_HOME"`
>> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
>> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>>     [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
>> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix "$GSHELL_HOME"`
>> fi
>>
>> -# Locate GSHELL_HOME if not it is not set
>> -if [ "x$GSHELL_HOME" = "x" ]; then
>> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
>> +# 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
>>
>> -# Determine the Java command to use to start the JVM
>> -if [ -z "$JAVACMD" ]; then
>> -    if [ -n "$JAVA_HOME" ]; then
>> -        JAVACMD="$JAVA_HOME/bin/java"
>> +# 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="$GSHELL_HOME"
>> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
>> +else
>> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
>> +        BASEDIR="$GSHELL_HOME"
>> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>>     else
>> -        JAVACMD="java"
>> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
>> +        echo "This file is needed to run this program"
>> +        exit 1
>>     fi
>> 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"`
>> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
>> +fi
>> +
>> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
>> if $cygwin ; then
>>     BOOTJAR=`cygpath --windows "$BOOTJAR"`
>> fi
>>
>> # Start the JVM
>> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>>
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat 
>> Mon Jun  9 09:00:31 2008
>> @@ -1,82 +1,86 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal enableextensions
>> -set ERRORLEVEL=0
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@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 command - you are running an unsupported 
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -:check_JAVACMD
>> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
>> -
>> -:check_JAVA_HOME
>> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
>> -set JAVACMD=java
>> -goto check_GSHELL_HOME
>> -
>> -:have_JAVA_HOME
>> -set JAVACMD=%JAVA_HOME%\bin\java
>> -goto check_GSHELL_HOME
>> +@REM Get standard environment variables
>> +@REM Users can optionally create this file to set environment variables.
>> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
>> +if not %errorlevel% == 0 goto end
>> +
>> +@REM Get standard Java environment variables
>> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
>> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
>> +set ERRORLEVEL=1
>> +goto end
>> +:okSetJavaEnv
>> +set BASEDIR=%DIRNAME%
>> +call "%DIRNAME%\setJavaEnv.bat"
>> +if not %errorlevel% == 0 goto end
>>
>> :check_GSHELL_HOME
>> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>>
>> :init
>> -rem Get command-line arguments, handling Windowz variants
>> -if not "%OS%" == "Windows_NT" goto win9xME_args
>> +rem Get command-line arguments, handling Windows variants
>> if "%eval[2+2]" == "4" goto 4NT_args
>>
>> rem Regular WinNT shell
>> -set ARGS=%*
>> -goto execute
>> -
>> -:win9xME_args
>> -rem Slurp the command line arguments.  This loop allows for an 
>> unlimited number
>> set ARGS=
>> -
>> -:win9xME_args_slurp
>> -if "x%1" == "x" goto execute
>> +:setArgs
>> +if ""%1""=="""" goto doneSetArgs
>> set ARGS=%ARGS% %1
>> shift
>> -goto win9xME_args_slurp
>> +goto setArgs
>> +:doneSetArgs
>> +goto execute
>>
>> :4NT_args
>> rem Get arguments from the 4NT Shell from JP Software
>> set ARGS=%$
>>
>> :execute
>> -
>> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>>
>> rem Start the JVM
>> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>>
>> :end
>> -
>> -if "%OS%"=="Windows_NT" endlocal
>> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
>> -
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server 
>> Mon Jun  9 09:00:31 2008
>> @@ -22,7 +22,61 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> +# --------------------------------------------------------------------
>> +# Startup script for Geronimo that starts Geronimo in the foreground.
>> +#
>> +# This script calls the gsh script passing "geronimo/start-server" as 
>> the
>> +# first argument followed by the arguments supplied by the caller.
>> +#
>> +# Alternatively you can use the more comprehensive gsh interface 
>> directly.
>> +#
>> +# Invocation Syntax:
>> +#
>> +#   start-server [geronimo_args ...]
>> +#
>> +# Environment Variable Prequisites:
>> +#
>> +#   Refer to the documentation in the gsh file for information
>> +#   on environment variables etc.
>> +#
>> +# --------------------------------------------------------------------
>> +
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +EXECUTABLE=gsh
>> +
>> +# Check that target executable exists
>> +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
>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>> +    echo "This file is needed to run this program"
>> +    exit 1
>> +  fi
>> +fi
>>
>> ARGS=
>> while [ $# -ge 1 ]; do
>> @@ -30,5 +84,5 @@
>>   shift
>> done
>>
>> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>>
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat 
>> Mon Jun  9 09:00:31 2008
>> @@ -1,37 +1,82 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@rem
>> +
>> +@rem 
>> --------------------------------------------------------------------
>> +@rem start-server batch file for Geronimo that starts Geronimo in 
>> foreground.
>> +@rem
>> +@rem This batch file calls the gsh.bat script passing 
>> "geronimo/start-server
>> +@rem followed by the arguments supplied by the caller.
>> +@rem
>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>> directly.
>> +@rem
>> +@rem Invocation Syntax:
>> +@rem
>> +@rem   start-server [geronimo_args ...]
>> +@rem
>> +@rem Environment Variable Prequisites:
>> +@rem
>> +@rem   Refer to the GShell documentation for information on environment
>> +@rem   variables etc.
>> +@rem
>> +@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 command - you are running an unsupported 
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>
>> -:end
>> +@REM Check that target executable exists
>> +if exist "%EXECUTABLE%" goto okExec
>> +echo ERROR - Cannot find required script %EXECUTABLE%
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okExec
>> +@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
>>
>> -if "%OS%"=="Windows_NT" endlocal
>> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>>
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server 
>> Mon Jun  9 09:00:31 2008
>> @@ -22,7 +22,61 @@
>> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May 2007) $
>> ##
>>
>> -DIRNAME=`dirname "$0"`
>> +# --------------------------------------------------------------------
>> +# Shutdown script for Geronimo that stops Geronimo in the foreground.
>> +#
>> +# This script calls the gsh script passing "geronimo/stop-server" as the
>> +# first argument followed by the arguments supplied by the caller.
>> +#
>> +# Alternatively you can use the more comprehensive gsh interface 
>> directly.
>> +#
>> +# Invocation Syntax:
>> +#
>> +#   stop-server [geronimo_args ...]
>> +#
>> +# Environment Variable Prequisites:
>> +#
>> +#   Refer to the documentation in the gsh file for information
>> +#   on environment variables etc.
>> +#
>> +# --------------------------------------------------------------------
>> +
>> +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
>> +
>> +PRGDIR=`dirname "$PRG"`
>> +EXECUTABLE=gsh
>> +
>> +# Check that target executable exists
>> +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
>> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
>> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
>> +    echo "This file is needed to run this program"
>> +    exit 1
>> +  fi
>> +fi
>>
>> ARGS=
>> while [ $# -ge 1 ]; do
>> @@ -30,5 +84,5 @@
>>   shift
>> done
>>
>> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
>> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>>
>>
>> Modified: 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>>
>> URL: 
>> http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff 
>>
>> ============================================================================== 
>>
>> --- 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>> (original)
>> +++ 
>> geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat 
>> Mon Jun  9 09:00:31 2008
>> @@ -1,37 +1,82 @@
>> -@if "%DEBUG%" == "" @echo off
>> -rem
>> -rem Licensed to the Apache Software Foundation (ASF) under one
>> -rem or more contributor license agreements.  See the NOTICE file
>> -rem distributed with this work for additional information
>> -rem regarding copyright ownership.  The ASF licenses this file
>> -rem to you under the Apache License, Version 2.0 (the
>> -rem "License"); you may not use this file except in compliance
>> -rem with the License.  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,
>> -rem software distributed under the License is distributed on an
>> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> -rem KIND, either express or implied.  See the License for the
>> -rem specific language governing permissions and limitations
>> -rem under the License.
>> -rem
>> -
>> -rem
>> -rem $Rev$ $Date$
>> -rem
>> -
>> -if "%OS%"=="Windows_NT" setlocal
>> -
>> -:begin
>> +@rem
>> +@rem Licensed to the Apache Software Foundation (ASF) under one
>> +@rem or more contributor license agreements.  See the NOTICE file
>> +@rem distributed with this work for additional information
>> +@rem regarding copyright ownership.  The ASF licenses this file
>> +@rem to you under the Apache License, Version 2.0 (the
>> +@rem "License"); you may not use this file except in compliance
>> +@rem with the License.  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,
>> +@rem software distributed under the License is distributed on an
>> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> +@rem KIND, either express or implied.  See the License for the
>> +@rem specific language governing permissions and limitations
>> +@rem under the License.
>> +@rem
>> +
>> +@rem
>> +@rem $Rev$ $Date$
>> +@rem
>> +
>> +@rem 
>> --------------------------------------------------------------------
>> +@rem stop-server batch file for Geronimo that stops Geronimo in 
>> foreground.
>> +@rem
>> +@rem This batch file calls the gsh.bat script passing 
>> "geronimo/stop-server
>> +@rem followed by the arguments supplied by the caller.
>> +@rem
>> +@rem Alternatively you can use the more comprehensive gsh.bat file 
>> directly.
>> +@rem
>> +@rem Invocation Syntax:
>> +@rem
>> +@rem   stop-server [geronimo_args ...]
>> +@rem
>> +@rem Environment Variable Prequisites:
>> +@rem
>> +@rem   Refer to the GShell documentation for information on environment
>> +@rem   variables etc.
>> +@rem
>> +@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 command - you are running an unsupported 
>> operating system.
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okOsCheck
>> +@setlocal enableextensions
>> +@set ERRORLEVEL=0
>>
>> set DIRNAME=%~dp0
>> if "%DIRNAME%" == "" set DIRNAME=.\
>> +cd /d %DIRNAME%
>>
>> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
>> +set EXECUTABLE=%DIRNAME%\gsh.bat
>>
>> -:end
>> +@REM Check that target executable exists
>> +if exist "%EXECUTABLE%" goto okExec
>> +echo ERROR - Cannot find required script %EXECUTABLE%
>> +set ERRORLEVEL=1
>> +goto end
>> +
>> +:okExec
>> +@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
>>
>> -if "%OS%"=="Windows_NT" endlocal
>> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>>
>> +:end
>> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
>> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
>> +@endlocal
>>
>>
> 
> 

Re: svn commit: r665729 - in /geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin: gsh gsh.bat start-server start-server.bat stop-server stop-server.bat

Posted by Jason Dillon <ja...@planet57.com>.
Pffff... I really dislike all this crap in the native platform  
scripts.  Just why is all this junk needed?

What is the os400 muck for?  Why do we care about resolving soft-links?

Why is setjavaenv.sh required?

Ugh... I think this is a mess.

--jason


On Jun 9, 2008, at 11:00 PM, dwoods@apache.org wrote:

> Author: dwoods
> Date: Mon Jun  9 09:00:31 2008
> New Revision: 665729
>
> URL: http://svn.apache.org/viewvc?rev=665729&view=rev
> Log:
> GERONIMO-4093 Enhance GShell based scripts to use setjavaenv for  
> determining the Java runtime, allow users to continue to supply a  
> setenv script and updated the Unix gsh script with some missing  
> Cygwin, OS400 and error checking that was in geronimo.sh.
>
> Modified:
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh.bat
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server.bat
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server
>    geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server.bat
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/gsh
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh Mon Jun  9 09:00:31 2008
> @@ -22,42 +22,90 @@
> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
> 2007) $
> ##
>
> -DIRNAME=`dirname "$0"`
> -
> # OS specific support (must be 'true' or 'false').
> cygwin=false
> +os400=false
> case "`uname`" in
> -    CYGWIN*)
> -        cygwin=true
> -        ;;
> +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
> +
> +PRGDIR=`dirname "$PRG"`
> +
> +# Locate GSHELL_HOME if not it is not set
> +if [ "x$GSHELL_HOME" = "x" ]; then
> +    GSHELL_HOME=`cd "$PRGDIR/.."; pwd`
> +fi
> +
> +# Execute optional environment  if provided by the user
> +if [ -r "$GSHELL_HOME"/bin/setenv.sh ]; then
> +    . "$GSHELL_HOME"/bin/setenv.sh
> +fi
> +
> # For Cygwin, ensure paths are in UNIX format before anything is  
> touched
> if $cygwin ; then
> -    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
> "$GSHELL_HOME"`
> -    [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
> +    [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
>     [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
> +    [ -n "$GSHELL_HOME" ] && GSHELL_HOME=`cygpath --unix  
> "$GSHELL_HOME"`
> fi
>
> -# Locate GSHELL_HOME if not it is not set
> -if [ "x$GSHELL_HOME" = "x" ]; then
> -    GSHELL_HOME=`cd "$DIRNAME/.."; pwd`
> +# 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
>
> -# Determine the Java command to use to start the JVM
> -if [ -z "$JAVACMD" ]; then
> -    if [ -n "$JAVA_HOME" ]; then
> -        JAVACMD="$JAVA_HOME/bin/java"
> +# 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="$GSHELL_HOME"
> +    . "$GSHELL_HOME"/bin/setjavaenv.sh
> +else
> +    if [ -r "$GSHELL_HOME"/bin/setjavaenv.sh ]; then
> +        BASEDIR="$GSHELL_HOME"
> +        . "$GSHELL_HOME"/bin/setjavaenv.sh
>     else
> -        JAVACMD="java"
> +        echo "Cannot find $GSHELL_HOME/bin/setjavaenv.sh"
> +        echo "This file is needed to run this program"
> +        exit 1
>     fi
> 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"`
> +    GSHELL_HOME=`cygpath --absolute --windows "$GSHELL_HOME"`
> +fi
> +
> BOOTJAR="$GSHELL_HOME/lib/boot/gshell-bootstrap.jar"
> if $cygwin ; then
>     BOOTJAR=`cygpath --windows "$BOOTJAR"`
> fi
>
> # Start the JVM
> -exec "$JAVACMD" $JAVA_OPTS -jar "$BOOTJAR" "$@"
> +exec "$_RUNJAVA" $JAVA_OPTS -jar "$BOOTJAR" "$@"
>
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/gsh.bat
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/gsh.bat?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh.bat (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/gsh.bat Mon Jun  9 09:00:31 2008
> @@ -1,82 +1,86 @@
> -@if "%DEBUG%" == "" @echo off
> -rem
> -rem Licensed to the Apache Software Foundation (ASF) under one
> -rem or more contributor license agreements.  See the NOTICE file
> -rem distributed with this work for additional information
> -rem regarding copyright ownership.  The ASF licenses this file
> -rem to you under the Apache License, Version 2.0 (the
> -rem "License"); you may not use this file except in compliance
> -rem with the License.  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,
> -rem software distributed under the License is distributed on an
> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -rem KIND, either express or implied.  See the License for the
> -rem specific language governing permissions and limitations
> -rem under the License.
> -rem
> -
> -rem
> -rem $Rev$ $Date$
> -rem
> -
> -if "%OS%"=="Windows_NT" setlocal enableextensions
> -set ERRORLEVEL=0
> -
> -:begin
> +@rem
> +@rem Licensed to the Apache Software Foundation (ASF) under one
> +@rem or more contributor license agreements.  See the NOTICE file
> +@rem distributed with this work for additional information
> +@rem regarding copyright ownership.  The ASF licenses this file
> +@rem to you under the Apache License, Version 2.0 (the
> +@rem "License"); you may not use this file except in compliance
> +@rem with the License.  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,
> +@rem software distributed under the License is distributed on an
> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +@rem KIND, either express or implied.  See the License for the
> +@rem specific language governing permissions and limitations
> +@rem under the License.
> +@rem
> +
> +@rem
> +@rem $Rev$ $Date$
> +@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 command - you are running an unsupported  
> operating system.
> +set ERRORLEVEL=1
> +goto end
> +
> +:okOsCheck
> +@setlocal enableextensions
> +@set ERRORLEVEL=0
>
> set DIRNAME=%~dp0
> if "%DIRNAME%" == "" set DIRNAME=.\
> +cd /d %DIRNAME%
>
> -:check_JAVACMD
> -if not "%JAVACMD%" == "" goto check_GSHELL_HOME
> -
> -:check_JAVA_HOME
> -if not "%JAVA_HOME%" == "" goto have_JAVA_HOME
> -set JAVACMD=java
> -goto check_GSHELL_HOME
> -
> -:have_JAVA_HOME
> -set JAVACMD=%JAVA_HOME%\bin\java
> -goto check_GSHELL_HOME
> +@REM Get standard environment variables
> +@REM Users can optionally create this file to set environment  
> variables.
> +if exist "%DIRNAME%\setenv.bat" call "%DIRNAME%\setenv.bat"
> +if not %errorlevel% == 0 goto end
> +
> +@REM Get standard Java environment variables
> +if exist "%DIRNAME%\setjavaenv.bat" goto okSetJavaEnv
> +echo ERROR - Cannot find %DIRNAME%\setjavaenv.bat
> +set ERRORLEVEL=1
> +goto end
> +:okSetJavaEnv
> +set BASEDIR=%DIRNAME%
> +call "%DIRNAME%\setJavaEnv.bat"
> +if not %errorlevel% == 0 goto end
>
> :check_GSHELL_HOME
> if "%GSHELL_HOME%" == "" set GSHELL_HOME=%DIRNAME%..
>
> :init
> -rem Get command-line arguments, handling Windowz variants
> -if not "%OS%" == "Windows_NT" goto win9xME_args
> +rem Get command-line arguments, handling Windows variants
> if "%eval[2+2]" == "4" goto 4NT_args
>
> rem Regular WinNT shell
> -set ARGS=%*
> -goto execute
> -
> -:win9xME_args
> -rem Slurp the command line arguments.  This loop allows for an  
> unlimited number
> set ARGS=
> -
> -:win9xME_args_slurp
> -if "x%1" == "x" goto execute
> +:setArgs
> +if ""%1""=="""" goto doneSetArgs
> set ARGS=%ARGS% %1
> shift
> -goto win9xME_args_slurp
> +goto setArgs
> +:doneSetArgs
> +goto execute
>
> :4NT_args
> rem Get arguments from the 4NT Shell from JP Software
> set ARGS=%$
>
> :execute
> -
> set BOOTJAR=%GSHELL_HOME%\lib\boot\gshell-bootstrap.jar
>
> rem Start the JVM
> -"%JAVACMD%" %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
> +%_RUNJAVA% %JAVA_OPTS% -jar "%BOOTJAR%" %ARGS%
>
> :end
> -
> -if "%OS%"=="Windows_NT" endlocal
> -if "%GSHELL_BATCH_PAUSE%" == "on" pause
> -
> +:end
> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
> +@endlocal
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/start-server
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server Mon Jun  9 09:00:31 2008
> @@ -22,7 +22,61 @@
> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
> 2007) $
> ##
>
> -DIRNAME=`dirname "$0"`
> +#  
> --------------------------------------------------------------------
> +# Startup script for Geronimo that starts Geronimo in the foreground.
> +#
> +# This script calls the gsh script passing "geronimo/start-server"  
> as the
> +# first argument followed by the arguments supplied by the caller.
> +#
> +# Alternatively you can use the more comprehensive gsh interface  
> directly.
> +#
> +# Invocation Syntax:
> +#
> +#   start-server [geronimo_args ...]
> +#
> +# Environment Variable Prequisites:
> +#
> +#   Refer to the documentation in the gsh file for information
> +#   on environment variables etc.
> +#
> +#  
> --------------------------------------------------------------------
> +
> +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
> +
> +PRGDIR=`dirname "$PRG"`
> +EXECUTABLE=gsh
> +
> +# Check that target executable exists
> +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
> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
> +    echo "This file is needed to run this program"
> +    exit 1
> +  fi
> +fi
>
> ARGS=
> while [ $# -ge 1 ]; do
> @@ -30,5 +84,5 @@
>   shift
> done
>
> -exec "$DIRNAME/gsh" -c "geronimo/start-server $ARGS"
> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/start-server $ARGS"
>
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/start-server.bat
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/start-server.bat?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server.bat (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/start-server.bat Mon Jun  9 09:00:31  
> 2008
> @@ -1,37 +1,82 @@
> -@if "%DEBUG%" == "" @echo off
> -rem
> -rem Licensed to the Apache Software Foundation (ASF) under one
> -rem or more contributor license agreements.  See the NOTICE file
> -rem distributed with this work for additional information
> -rem regarding copyright ownership.  The ASF licenses this file
> -rem to you under the Apache License, Version 2.0 (the
> -rem "License"); you may not use this file except in compliance
> -rem with the License.  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,
> -rem software distributed under the License is distributed on an
> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -rem KIND, either express or implied.  See the License for the
> -rem specific language governing permissions and limitations
> -rem under the License.
> -rem
> -
> -rem
> -rem $Rev$ $Date$
> -rem
> -
> -if "%OS%"=="Windows_NT" setlocal
> -
> -:begin
> +@rem
> +@rem Licensed to the Apache Software Foundation (ASF) under one
> +@rem or more contributor license agreements.  See the NOTICE file
> +@rem distributed with this work for additional information
> +@rem regarding copyright ownership.  The ASF licenses this file
> +@rem to you under the Apache License, Version 2.0 (the
> +@rem "License"); you may not use this file except in compliance
> +@rem with the License.  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,
> +@rem software distributed under the License is distributed on an
> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +@rem KIND, either express or implied.  See the License for the
> +@rem specific language governing permissions and limitations
> +@rem under the License.
> +@rem
> +
> +@rem
> +@rem $Rev$ $Date$
> +@rem
> +
> +@rem  
> --------------------------------------------------------------------
> +@rem start-server batch file for Geronimo that starts Geronimo in  
> foreground.
> +@rem
> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
> start-server
> +@rem followed by the arguments supplied by the caller.
> +@rem
> +@rem Alternatively you can use the more comprehensive gsh.bat file  
> directly.
> +@rem
> +@rem Invocation Syntax:
> +@rem
> +@rem   start-server [geronimo_args ...]
> +@rem
> +@rem Environment Variable Prequisites:
> +@rem
> +@rem   Refer to the GShell documentation for information on  
> environment
> +@rem   variables etc.
> +@rem
> +@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 command - you are running an unsupported  
> operating system.
> +set ERRORLEVEL=1
> +goto end
> +
> +:okOsCheck
> +@setlocal enableextensions
> +@set ERRORLEVEL=0
>
> set DIRNAME=%~dp0
> if "%DIRNAME%" == "" set DIRNAME=.\
> +cd /d %DIRNAME%
>
> -"%DIRNAME%\gsh.bat" -c "geronimo/start-server %*"
> +set EXECUTABLE=%DIRNAME%\gsh.bat
>
> -:end
> +@REM Check that target executable exists
> +if exist "%EXECUTABLE%" goto okExec
> +echo ERROR - Cannot find required script %EXECUTABLE%
> +set ERRORLEVEL=1
> +goto end
> +
> +:okExec
> +@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
>
> -if "%OS%"=="Windows_NT" endlocal
> +call "%EXECUTABLE%" -c "geronimo/start-server %CMD_LINE_ARGS%"
>
> +:end
> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
> +@endlocal
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/stop-server
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server Mon Jun  9 09:00:31 2008
> @@ -22,7 +22,61 @@
> ## $Rev: 539227 $ $Date: 2007-05-17 19:48:49 -0700 (Thu, 17 May  
> 2007) $
> ##
>
> -DIRNAME=`dirname "$0"`
> +#  
> --------------------------------------------------------------------
> +# Shutdown script for Geronimo that stops Geronimo in the foreground.
> +#
> +# This script calls the gsh script passing "geronimo/stop-server"  
> as the
> +# first argument followed by the arguments supplied by the caller.
> +#
> +# Alternatively you can use the more comprehensive gsh interface  
> directly.
> +#
> +# Invocation Syntax:
> +#
> +#   stop-server [geronimo_args ...]
> +#
> +# Environment Variable Prequisites:
> +#
> +#   Refer to the documentation in the gsh file for information
> +#   on environment variables etc.
> +#
> +#  
> --------------------------------------------------------------------
> +
> +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
> +
> +PRGDIR=`dirname "$PRG"`
> +EXECUTABLE=gsh
> +
> +# Check that target executable exists
> +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
> +  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
> +    echo "Cannot find $PRGDIR/$EXECUTABLE"
> +    echo "This file is needed to run this program"
> +    exit 1
> +  fi
> +fi
>
> ARGS=
> while [ $# -ge 1 ]; do
> @@ -30,5 +84,5 @@
>   shift
> done
>
> -exec "$DIRNAME/gsh" -c "geronimo/stop-server $ARGS"
> +exec "$PRGDIR"/"$EXECUTABLE" -c "geronimo/stop-server $ARGS"
>
>
> Modified: geronimo/server/branches/2.1/assemblies/geronimo- 
> boilerplate-minimal/src/main/underlay/bin/stop-server.bat
> URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/stop-server.bat?rev=665729&r1=665728&r2=665729&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server.bat (original)
> +++ geronimo/server/branches/2.1/assemblies/geronimo-boilerplate- 
> minimal/src/main/underlay/bin/stop-server.bat Mon Jun  9 09:00:31 2008
> @@ -1,37 +1,82 @@
> -@if "%DEBUG%" == "" @echo off
> -rem
> -rem Licensed to the Apache Software Foundation (ASF) under one
> -rem or more contributor license agreements.  See the NOTICE file
> -rem distributed with this work for additional information
> -rem regarding copyright ownership.  The ASF licenses this file
> -rem to you under the Apache License, Version 2.0 (the
> -rem "License"); you may not use this file except in compliance
> -rem with the License.  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,
> -rem software distributed under the License is distributed on an
> -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> -rem KIND, either express or implied.  See the License for the
> -rem specific language governing permissions and limitations
> -rem under the License.
> -rem
> -
> -rem
> -rem $Rev$ $Date$
> -rem
> -
> -if "%OS%"=="Windows_NT" setlocal
> -
> -:begin
> +@rem
> +@rem Licensed to the Apache Software Foundation (ASF) under one
> +@rem or more contributor license agreements.  See the NOTICE file
> +@rem distributed with this work for additional information
> +@rem regarding copyright ownership.  The ASF licenses this file
> +@rem to you under the Apache License, Version 2.0 (the
> +@rem "License"); you may not use this file except in compliance
> +@rem with the License.  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,
> +@rem software distributed under the License is distributed on an
> +@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> +@rem KIND, either express or implied.  See the License for the
> +@rem specific language governing permissions and limitations
> +@rem under the License.
> +@rem
> +
> +@rem
> +@rem $Rev$ $Date$
> +@rem
> +
> +@rem  
> --------------------------------------------------------------------
> +@rem stop-server batch file for Geronimo that stops Geronimo in  
> foreground.
> +@rem
> +@rem This batch file calls the gsh.bat script passing "geronimo/ 
> stop-server
> +@rem followed by the arguments supplied by the caller.
> +@rem
> +@rem Alternatively you can use the more comprehensive gsh.bat file  
> directly.
> +@rem
> +@rem Invocation Syntax:
> +@rem
> +@rem   stop-server [geronimo_args ...]
> +@rem
> +@rem Environment Variable Prequisites:
> +@rem
> +@rem   Refer to the GShell documentation for information on  
> environment
> +@rem   variables etc.
> +@rem
> +@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 command - you are running an unsupported  
> operating system.
> +set ERRORLEVEL=1
> +goto end
> +
> +:okOsCheck
> +@setlocal enableextensions
> +@set ERRORLEVEL=0
>
> set DIRNAME=%~dp0
> if "%DIRNAME%" == "" set DIRNAME=.\
> +cd /d %DIRNAME%
>
> -"%DIRNAME%\gsh.bat" -c "geronimo/stop-server %*"
> +set EXECUTABLE=%DIRNAME%\gsh.bat
>
> -:end
> +@REM Check that target executable exists
> +if exist "%EXECUTABLE%" goto okExec
> +echo ERROR - Cannot find required script %EXECUTABLE%
> +set ERRORLEVEL=1
> +goto end
> +
> +:okExec
> +@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
>
> -if "%OS%"=="Windows_NT" endlocal
> +call "%EXECUTABLE%" -c "geronimo/stop-server %CMD_LINE_ARGS%"
>
> +:end
> +@REM pause the batch file if GERONIMO_BATCH_PAUSE is set to 'on'
> +if "%GERONIMO_BATCH_PAUSE%" == "on" pause
> +@endlocal
>
>