Thanks Christopher, works like a charm!
Regards
Peter
>
> Peter,
>
> Peter Björkman wrote:
> > Hi! I'm setting up an environment where I need a lot of
> differens web
> > containers running, and part of that is setting up tomcat5.0 to run
> > multiple instances.
> >
> > I tried to find a startup/stop script and this is what I came up
> > with:
>
> [snip]
>
> > but that won't work, it randomly starts, stopping stops all
> instances
> > and the general behaviour is strange.
> >
> > Any ideas? Can you point me to a better startup script
>
> Not sure what's wrong with your script, but I have used this one for
> years. It's completely parameterized and intended to be used from ant,
> although there's no reason not to use it directly from the
> command line.
>
> Hope this helps,
> - -chris
>
> #!/bin/sh
> # name: tomcat.sh
> # args:
> # start|stop
> # java-home=S OPTIONAL (uses JAVA_HOME otherwise)
> # tomcat-home=S REQUIRED
> # tomcat-port=N REQUIRED
> # tomcat-shutdown-port=n REQUIRED
> # project-base-dir=S REQUIRED
>
> SCRIPT=`basename $0`
> USAGE="usage: ${SCRIPT} start|stop [java-home=S] tomcat-home=S
> tomcat-port=N tomcat-shutdown-port=N project-base-dir=S"
>
> while test $# -gt 0
> do
> case "x$1" in
> xstart)
> MODE=start
> ;;
> xstop)
> MODE=stop
> ;;
> xjava-home=*)
> JAVA_HOME=`expr $1 : 'java-home=\(.*\)'`
> ;;
> xtomcat-port=*)
> TOMCAT_PORT=`expr $1 : 'tomcat-port=\(.*\)'`
> ;;
> xtomcat-shutdown-port=*)
> TOMCAT_SHUTDOWN_PORT=`expr $1 :
> 'tomcat-shutdown-port=\(.*\)'`
> ;;
> xproject-base-dir=*)
> PROJECT_BASE_DIR=`expr $1 : 'project-base-dir=\(.*\)'`
> ;;
> xtomcat-home=*)
> TOMCAT_HOME=`expr $1 : 'tomcat-home=\(.*\)'`
> ;;
> x*)
> echo "Invalid argument: $1."
> echo "${USAGE}"
> exit 1
> ;;
> esac
> shift
> done
> if test -z "${TOMCAT_PORT}" -o -z "${TOMCAT_SHUTDOWN_PORT}" -o -z
> "${PROJECT_BASE_DIR}" -o -z "${TOMCAT_HOME}"
> then
> echo "${USAGE}"
> exit 1
> fi
> case "x$MODE" in
> xstart|xstop)
> ;;
> *)
> echo "${USAGE}"
> exit 1
> ;;
> esac
>
> CATALINA_BASE=$PROJECT_BASE_DIR
>
> export TOMCAT_SHUTDOWN_PORT TOMCAT_PORT CATALINA_BASE TOMCAT_HOME
>
> echo "${SCRIPT}: JAVA_HOME is $JAVA_HOME"
> echo "${SCRIPT}: TOMCAT_PORT is $TOMCAT_PORT"
> echo "${SCRIPT}: TOMCAT_SHUTDOWN_PORT is $TOMCAT_SHUTDOWN_PORT"
> echo "${SCRIPT}: CATALINA_BASE is $CATALINA_BASE"
> echo "${SCRIPT}: TOMCAT_HOME is $TOMCAT_HOME"
>
> case "x${MODE}" in
> xstart)
> echo "${SCRIPT} signing off - exec'ing
> $TOMCAT_HOME/bin/startup.sh"
> exec "$TOMCAT_HOME/bin/startup.sh"
> ;;
> xstop)
> echo "${SCRIPT} signing off - exec'ing
> $TOMCAT_HOME/bin/shutdown.sh"
> exec "$TOMCAT_HOME/bin/shutdown.sh"
> ;;
> esac
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF9WQ19CaO5/Lv0PARAryDAJ9BGZGW6xCMX+O55lnhyntw0E99RQCgg/71
> DPkGrIzaXMbwh+/5heCeTtc=
> =uOP+
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: [email protected]
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]