| 1 |
#! /bin/sh |
|---|
| 2 |
|
|---|
| 3 |
# Script to start jboss with properties defined |
|---|
| 4 |
# This currently needs to be executed out of the quickstart directory |
|---|
| 5 |
# (via a source) |
|---|
| 6 |
|
|---|
| 7 |
BASE_DIR=`pwd` |
|---|
| 8 |
|
|---|
| 9 |
PRG="$0" |
|---|
| 10 |
|
|---|
| 11 |
usage() { |
|---|
| 12 |
echo " $PRG [-heap size] [-newsize size] [-permgen size] [-debug]" |
|---|
| 13 |
echo " [-debugexprfilters name] [-activemquri uri]" |
|---|
| 14 |
echo "" |
|---|
| 15 |
echo " Where:" |
|---|
| 16 |
echo "" |
|---|
| 17 |
echo " -heap sets the heap size and should be n for bytes" |
|---|
| 18 |
echo " nK for kilo-bytes (e.g. 2560000K)" |
|---|
| 19 |
echo " nM for mega-bytes (e.g. 2560M)" |
|---|
| 20 |
echo " nG for giga-bytes (e.g. 1G)" |
|---|
| 21 |
echo " Default: $heap" |
|---|
| 22 |
echo "" |
|---|
| 23 |
echo " -newsize sets the new generation size and has the same form as -heap" |
|---|
| 24 |
echo " the value should be around one third of the heap" |
|---|
| 25 |
echo " Default: $newsize" |
|---|
| 26 |
echo "" |
|---|
| 27 |
echo " -permsize sets the permgen size and has the same form as -heap" |
|---|
| 28 |
echo " The value should probably not be less than 256M" |
|---|
| 29 |
echo " Default: $permsize" |
|---|
| 30 |
echo "" |
|---|
| 31 |
echo " -debug sets the logging level to DEBUG" |
|---|
| 32 |
echo "" |
|---|
| 33 |
echo " -debugexprfilters sets the logging level for bedework expression filters to DEBUG" |
|---|
| 34 |
echo "" |
|---|
| 35 |
echo " -activemquri sets the uri used by the activemq broker for bedework" |
|---|
| 36 |
echo " Some possibilities: vm://localhost tcp://localhost:61616" |
|---|
| 37 |
echo " Default: $activemquri" |
|---|
| 38 |
echo "" |
|---|
| 39 |
echo " -portoffset sets the offset for the standard jboss ports allowing" |
|---|
| 40 |
echo " multiple instances to be run on the same machine. The activemquri" |
|---|
| 41 |
echo " value may need to be set explicitly if it uses a port." |
|---|
| 42 |
echo " Default: $portoffset" |
|---|
| 43 |
echo "" |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
# ===================== Defaults ================================= |
|---|
| 47 |
heap="600M" |
|---|
| 48 |
newsize="200M" |
|---|
| 49 |
permsize="256M" |
|---|
| 50 |
|
|---|
| 51 |
portoffset=0 |
|---|
| 52 |
|
|---|
| 53 |
activemquri="vm://localhost" |
|---|
| 54 |
|
|---|
| 55 |
exprfilters=INFO |
|---|
| 56 |
|
|---|
| 57 |
# =================== End defaults =============================== |
|---|
| 58 |
|
|---|
| 59 |
LOG_THRESHOLD="-Djboss.server.log.threshold=INFO" |
|---|
| 60 |
|
|---|
| 61 |
while [ "$1" != "" ] |
|---|
| 62 |
do |
|---|
| 63 |
# Process the next arg |
|---|
| 64 |
case $1 # Look at $1 |
|---|
| 65 |
in |
|---|
| 66 |
-usage | -help | -? | ?) |
|---|
| 67 |
usage |
|---|
| 68 |
exit |
|---|
| 69 |
;; |
|---|
| 70 |
-heap) # Heap size bytes or nK, nM, nG |
|---|
| 71 |
shift |
|---|
| 72 |
heap="$1" |
|---|
| 73 |
shift |
|---|
| 74 |
;; |
|---|
| 75 |
-newsize) |
|---|
| 76 |
shift |
|---|
| 77 |
newsize="$1" |
|---|
| 78 |
shift |
|---|
| 79 |
;; |
|---|
| 80 |
-permsize) |
|---|
| 81 |
shift |
|---|
| 82 |
permsize="$1" |
|---|
| 83 |
shift |
|---|
| 84 |
;; |
|---|
| 85 |
-debug) |
|---|
| 86 |
shift |
|---|
| 87 |
LOG_THRESHOLD="-Djboss.server.log.threshold=DEBUG" |
|---|
| 88 |
;; |
|---|
| 89 |
-debugexprfilters) |
|---|
| 90 |
shift |
|---|
| 91 |
exprfilters=DEBUG |
|---|
| 92 |
shift |
|---|
| 93 |
;; |
|---|
| 94 |
-portoffset) |
|---|
| 95 |
shift |
|---|
| 96 |
portoffset="$1" |
|---|
| 97 |
shift |
|---|
| 98 |
;; |
|---|
| 99 |
-activemquri) |
|---|
| 100 |
shift |
|---|
| 101 |
activemquri="$1" |
|---|
| 102 |
shift |
|---|
| 103 |
;; |
|---|
| 104 |
*) |
|---|
| 105 |
usage |
|---|
| 106 |
exit 1 |
|---|
| 107 |
;; |
|---|
| 108 |
esac |
|---|
| 109 |
done |
|---|
| 110 |
|
|---|
| 111 |
JBOSS_VERSION="jboss-5.1.0.GA" |
|---|
| 112 |
JBOSS_CONFIG="default" |
|---|
| 113 |
JBOSS_SERVER_DIR="$BASE_DIR/$JBOSS_VERSION/server/$JBOSS_CONFIG" |
|---|
| 114 |
JBOSS_DATA_DIR="$JBOSS_SERVER_DIR/data" |
|---|
| 115 |
|
|---|
| 116 |
# If this is empty only localhost will be available. |
|---|
| 117 |
# With this address anybody can access the consoles if they are not locked down. |
|---|
| 118 |
JBOSS_BIND="-b 0.0.0.0" |
|---|
| 119 |
|
|---|
| 120 |
LOG_LEVELS="-Dorg.bedework.loglevel.exprfilters=$exprfilters" |
|---|
| 121 |
|
|---|
| 122 |
# |
|---|
| 123 |
# Port shifting |
|---|
| 124 |
# |
|---|
| 125 |
|
|---|
| 126 |
# standard ports |
|---|
| 127 |
JBOSS_PORTS=-Dorg.bedework.system.ports.offset=$portoffset |
|---|
| 128 |
|
|---|
| 129 |
# standard ports + defined value |
|---|
| 130 |
#JBOSS_PORTS="-Dorg.bedework.system.ports.offset=505 -Djboss.service.binding.set=ports-syspar" |
|---|
| 131 |
|
|---|
| 132 |
ACTIVEMQ_DIRPREFIX="-Dorg.apache.activemq.default.directory.prefix=$JBOSS_DATA_DIR/" |
|---|
| 133 |
ACTIVEMQ_URI="-Dorg.bedework.activemq.uri=$activemquri" |
|---|
| 134 |
|
|---|
| 135 |
BW_DATA_DIR=$JBOSS_DATA_DIR/bedework |
|---|
| 136 |
BW_DATA_DIR_DEF=-Dorg.bedework.data.dir=$BW_DATA_DIR/ |
|---|
| 137 |
|
|---|
| 138 |
JAVA_OPTS="$JAVA_OPTS -Xms$heap -Xmx$heap" |
|---|
| 139 |
JAVA_OPTS="$JAVA_OPTS -XX:NewSize=$newsize -XX:MaxNewSize=$newsize" |
|---|
| 140 |
export JAVA_OPTS="$JAVA_OPTS -XX:PermSize=$permsize -XX:MaxPermSize=$permsize" |
|---|
| 141 |
|
|---|
| 142 |
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" |
|---|
| 143 |
|
|---|
| 144 |
echo $RUN_CMD |
|---|
| 145 |
|
|---|
| 146 |
$RUN_CMD |
|---|
| 147 |
|
|---|