#! /bin/sh # Script to start jboss with properties defined # This currently needs to be executed out of the quickstart directory # (via a source) BASE_DIR=`pwd` PRG="$0" usage() { echo " $PRG [-heap size] [-newsize size] [-permgen size] [-debug]" echo " [-debugexprfilters name] [-activemquri uri]" echo "" echo " Where:" echo "" echo " -heap sets the heap size and should be n for bytes" echo " nK for kilo-bytes (e.g. 2560000K)" echo " nM for mega-bytes (e.g. 2560M)" echo " nG for giga-bytes (e.g. 1G)" echo " Default: $heap" echo "" echo " -permsize sets the permgen size and has the same form as -heap" echo " The value should probably not be less than 256M" echo " Default: $permsize" echo "" echo " -debug sets the logging level to DEBUG" echo "" echo " -debugexprfilters sets the logging level for bedework expression filters to DEBUG" echo "" echo " -activemquri sets the uri used by the activemq broker for bedework" echo " Some possibilities: vm://localhost tcp://localhost:61616" echo " Default: $activemquri" echo "" echo " -portoffset sets the offset for the standard jboss ports allowing" echo " multiple instances to be run on the same machine. The activemquri" echo " value may need to be set explicitly if it uses a port." echo " Default: $portoffset" echo "" } # ===================== Defaults ================================= heap="600M" newsize="200M" permsize="256M" portoffset=0 activemquri="vm://localhost" exprfilters=INFO # =================== End defaults =============================== LOG_THRESHOLD="-Djboss.server.log.threshold=INFO" JBOSS_VERSION="jboss-5.1.0.GA" while [ "$1" != "" ] do # Process the next arg case $1 # Look at $1 in -usage | -help | -? | ?) usage exit ;; -heap) # Heap size bytes or nK, nM, nG shift heap="$1" shift ;; -newsize) shift newsize="$1" shift ;; -permsize) shift permsize="$1" shift ;; -jboss) shift JBOSS_VERSION="$1" shift ;; -debug) shift LOG_THRESHOLD="-Djboss.server.log.threshold=DEBUG" ;; -debugexprfilters) shift exprfilters=DEBUG shift ;; -portoffset) shift portoffset="$1" shift ;; -activemquri) shift activemquri="$1" shift ;; *) usage exit 1 ;; esac done JBOSS_CONFIG="default" JBOSS_SERVER_DIR="$BASE_DIR/$JBOSS_VERSION/server/$JBOSS_CONFIG" JBOSS_DATA_DIR="$JBOSS_SERVER_DIR/data" # If this is empty only localhost will be available. # With this address anybody can access the consoles if they are not locked down. JBOSS_BIND="-b 0.0.0.0" LOG_LEVELS="-Dorg.bedework.loglevel.exprfilters=$exprfilters" # # Port shifting # # standard ports JBOSS_PORTS=-Dorg.bedework.system.ports.offset=$portoffset # standard ports + defined value #JBOSS_PORTS="-Dorg.bedework.system.ports.offset=505 -Djboss.service.binding.set=ports-syspar" ACTIVEMQ_DIRPREFIX="-Dorg.apache.activemq.default.directory.prefix=$JBOSS_DATA_DIR/" ACTIVEMQ_URI="-Dorg.bedework.activemq.uri=$activemquri" BW_DATA_DIR=$JBOSS_DATA_DIR/bedework BW_DATA_DIR_DEF=-Dorg.bedework.data.dir=$BW_DATA_DIR/ JAVA_OPTS="$JAVA_OPTS -Xms$heap -Xmx$heap" # Don't set since java 1.4JAVA_OPTS="$JAVA_OPTS -XX:NewSize=$newsize -XX:MaxNewSize=$newsize" export JAVA_OPTS="$JAVA_OPTS -XX:PermSize=$permsize -XX:MaxPermSize=$permsize" RUN_CMD="./$JBOSS_VERSION/bin/run.sh -c $JBOSS_CONFIG $JBOSS_BIND $JBOSS_PORTS $LOG_THRESHOLD $LOG_LEVELS $ACTIVEMQ_DIRPREFIX $ACTIVEMQ_URI $BW_DATA_DIR_DEF" echo $RUN_CMD $RUN_CMD