tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hari...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/shell tomcat.bat tomcat.sh
Date Thu, 25 Nov 1999 20:42:25 GMT
harishp     99/11/25 12:42:22

  Modified:    .        build.sh
  Added:       src/shell tomcat.bat tomcat.sh
  Log:
  Added 2 new scripts. One for unix and another for windoz.
  
  Why?. startup and shutdown pretty much do the same thing..... Everytime
  there is a change in the classpath/environment etc. we would need to
  change both the scripts... Which is a drag..  "if-then-else"
  statements are for exactly this purpose.....
  
  These script are intended to replace startup and shutdown scripts.
  You can now use:
  
  ./tomcat.sh -start
  ./tomcat.sh -stop
  
  instead.
  
  I don't have a windoz machine so, I could not test the tomcat.bat
  script. It should work. Can someone verify it for me?
  
  Once everyone moves over to the new script, the intent is to remove
  startup and shutdown scripts.
  
  I have changed the build.sh to give execute permission to all shell
  script after building. I got tired to doing chmod +x startup.sh
  everytime I did a clean build.
  
  Revision  Changes    Path
  1.2       +4 -2      jakarta-tomcat/build.sh
  
  Index: build.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.sh	1999/10/09 00:19:57	1.1
  +++ build.sh	1999/11/25 20:42:10	1.2
  @@ -1,7 +1,9 @@
   #! /bin/sh
   
  -# $Id: build.sh,v 1.1 1999/10/09 00:19:57 duncan Exp $
  +# $Id: build.sh,v 1.2 1999/11/25 20:42:10 harishp Exp $
   
  -cp=../jakarta-tools/ant.jar:../jakarta-tools/projectx-tr2.jar
  +cp=../jakarta-tools/ant.jar:../jakarta-tools/projectx-tr2.jar:../build/tomcat/classes
   
   java -classpath $cp:$CLASSPATH org.apache.tools.ant.Main $*
  +
  +chmod +x `find ../build -name "*.sh"`
  
  
  
  1.1                  jakarta-tomcat/src/shell/tomcat.bat
  
  Index: tomcat.bat
  ===================================================================
  @echo off
  rem $Id: tomcat.bat,v 1.1 1999/11/25 20:42:20 harishp Exp $
  rem A batch file to start/stop tomcat server.
  
  rem This batch file written and tested under Windows NT
  rem Improvements to this file are welcome
  
  set jsdkJars=.\webserver.jar;.\lib\servlet.jar
  set jspJars=.\lib\jasper.jar
  set beanJars=.\webpages\WEB-INF\classes\jsp\beans;
  set miscJars=.\lib\xml.jar
  set appJars=%jsdkJars%;%jspJars%;%beanJars%;%miscJars%
  set sysJars=%JAVA_HOME%\lib\tools.jar
  
  set appClassPath=.\classes;%appJars%
  set cp=%CLASSPATH%
  
  set CLASSPATH=%appClassPath%;%sysJars%
  
  if "%cp%" == "" goto next
  
  rem else 
  set CLASSPATH=%CLASSPATH%;%cp% 
   
  :next
  if "%1" == "-start" goto startServer
  if "%1" == "-stop" goto stopServer
  @echo on
  @echo Usage:
  @echo tomcat [-start|-stop]
  @echo off
  goto cleanup
  
  :startServer
  rem Start the Tomcat Server
  @echo on
  @echo Using classpath: %CLASSPATH%
  @echo off
  start java org.apache.tomcat.shell.Startup %2 %3 %4 %5 %6 %7 %8 %9
  goto cleanup
  
  :stopServer
  rem Stop the Tomcat Server
  @echo on
  @echo Using classpath: %CLASSPATH%
  @echo off
  java org.apache.tomcat.shell.Shutdown %2 %3 %4 %5 %6 %7 %8 %9
  goto cleanup
  
  :cleanup
  rem clean up
  
  set CLASSPATH=%cp%
  set port=
  set host=
  set test=
  set jsdkJars=
  set jspJars=
  set beanJars=
  set miscJars=
  set appJars=
  set appClassPath=
  set cp=
  
  rem pause
  
  
  
  1.1                  jakarta-tomcat/src/shell/tomcat.sh
  
  Index: tomcat.sh
  ===================================================================
  #!/bin/sh
  #
  # $Id: tomcat.sh,v 1.1 1999/11/25 20:42:21 harishp Exp $
  
  # Shell script to start and stop the server
  
  # There are other, simpler commands to startup the runner. The two
  # commented commands good replacements. The first works well with
  # Java Platform 1.1 based runtimes. The second works well with
  # Java2 Platform based runtimes.
  
  #jre -cp runner.jar:servlet.jar:classes org.apache.tomcat.shell.Startup $*
  #java -cp runner.jar:servlet.jar:classes org.apache.tomcat.shell.Startup $*
  
  baseDir=`dirname $0`
  
  jsdkJars=${baseDir}/webserver.jar:${baseDir}/lib/servlet.jar
  jspJars=${baseDir}/lib/jasper.jar
  beanJars=${baseDir}/webpages/WEB-INF/classes/jsp/beans
  miscJars=${baseDir}/lib/xml.jar
  appJars=${jsdkJars}:${jspJars}:${beanJars}:${miscJars}
  sysJars=${JAVA_HOME}/lib/tools.jar
  
  appClassPath=${appJars}
  cp=$CLASSPATH
  
  # Backdoor classpath setting for development purposes when all classes
  # are compiled into a /classes dir and are not yet jarred.
  
  if [ -d ${baseDir}/classes ]; then
      appClassPath=${baseDir}/classes:${appClassPath}
  fi
  
  CLASSPATH=${appClassPath}:${sysJars}
  export CLASSPATH
  
  if [ "$cp" != "" ]; then
      CLASSPATH=${CLASSPATH}:${cp}
      export CLASSPATH
  fi
  
  
  # We start the server up in the background for a couple of reasons:
  #   1) It frees up your command window
  #   2) You should use `-stop` option instead of ^C to bring down the server
  
  if test "$1" = "-start" 
  then 
  shift 
  echo Using classpath: ${CLASSPATH}
  java org.apache.tomcat.shell.Startup $* &
  elif test "$1" = "-stop"
  then 
  shift 
  echo Using classpath: ${CLASSPATH}
  java org.apache.tomcat.shell.Shutdown $*
  else
  echo "Usage:"
  echo "tomcat [-start|-stop]"
  exit 0
  fi
  
  
  if [ "$cp" != "" ]; then
      CLASSPATH=${cp}
      export CLASSPATH
  else
      unset CLASSPATH
  fi
  
  
  

Mime
View raw message