| 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 " [-debugmodule name]" |
|---|
| 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 "" |
|---|
| 22 |
echo " -newsize sets the new generation size and has the same form as -heap" |
|---|
| 23 |
echo " the value should be around one third of the heap" |
|---|
| 24 |
echo "" |
|---|
| 25 |
echo " -permsize sets the permgen size and has the same form as -heap" |
|---|
| 26 |
echo " The value should probably not be less than 256M" |
|---|
| 27 |
echo "" |
|---|
| 28 |
echo " -debug sets the logging level to DEBUG" |
|---|
| 29 |
echo "" |
|---|
| 30 |
echo " -debugmodule sets the logging level for module name to DEBUG" |
|---|
| 31 |
echo " This sets a system variable org.bedework.loglevel.<name> which" |
|---|
| 32 |
echo " may be referenced by the log4j configuration" |
|---|
| 33 |
echo "" |
|---|
| 34 |
echo "Default settings:" |
|---|
| 35 |
echo "heap = $heap" |
|---|
| 36 |
echo "newsize = $newsize" |
|---|
| 37 |
echo "permsize = $permsize" |
|---|
| 38 |
echo "" |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|
| 41 |
heap="600M" |
|---|
| 42 |
newsize="200M" |
|---|
| 43 |
permsize="256M" |
|---|
| 44 |
|
|---|
| 45 |
LOG_THRESHOLD="-Djboss.server.log.threshold=INFO" |
|---|
| 46 |
LOG_LEVELS="" |
|---|
| 47 |
|
|---|
| 48 |
while [ "$1" != "" ] |
|---|
| 49 |
do |
|---|
| 50 |
# Process the next arg |
|---|
| 51 |
case $1 # Look at $1 |
|---|
| 52 |
in |
|---|
| 53 |
-usage | -help | -? | ?) |
|---|
| 54 |
usage |
|---|
| 55 |
exit |
|---|
| 56 |
shift |
|---|
| 57 |
;; |
|---|
| 58 |
-heap) # Heap size bytes or nK, nM, nG |
|---|
| 59 |
shift |
|---|
| 60 |
heap="$1" |
|---|
| 61 |
shift |
|---|
| 62 |
;; |
|---|
| 63 |
-newsize) |
|---|
| 64 |
shift |
|---|
| 65 |
newsize="$1" |
|---|
| 66 |
shift |
|---|
| 67 |
;; |
|---|
| 68 |
-permsize) |
|---|
| 69 |
shift |
|---|
| 70 |
permsize="$1" |
|---|
| 71 |
shift |
|---|
| 72 |
;; |
|---|
| 73 |
-debug) |
|---|
| 74 |
shift |
|---|
| 75 |
LOG_THRESHOLD="-Djboss.server.log.threshold=DEBUG" |
|---|
| 76 |
;; |
|---|
| 77 |
-debugmodule) |
|---|
| 78 |
shift |
|---|
| 79 |
LOG_LEVELS="$LOG_LEVELS -Dorg.bedework.loglevel.$1=DEBUG" |
|---|
| 80 |
shift |
|---|
| 81 |
;; |
|---|
| 82 |
*) |
|---|
| 83 |
usage |
|---|
| 84 |
exit 1 |
|---|
| 85 |
;; |
|---|
| 86 |
esac |
|---|
| 87 |
done |
|---|
| 88 |
|
|---|
| 89 |
JBOSS_VERSION="jboss-5.1.0.GA" |
|---|
| 90 |
JBOSS_CONFIG="default" |
|---|
| 91 |
JBOSS_SERVER_DIR="$BASE_DIR/$JBOSS_VERSION/server/$JBOSS_CONFIG" |
|---|
| 92 |
JBOSS_DATA_DIR="$JBOSS_SERVER_DIR/data" |
|---|
| 93 |
|
|---|
| 94 |
# If this is empty only localhost will be available. |
|---|
| 95 |
# With this address anybody can access the consoles if they are not locked down. |
|---|
| 96 |
JBOSS_BIND="-b 0.0.0.0" |
|---|
| 97 |
|
|---|
| 98 |
# |
|---|
| 99 |
# Port shifting |
|---|
| 100 |
# |
|---|
| 101 |
|
|---|
| 102 |
# standard ports |
|---|
| 103 |
JBOSS_PORTS=-Dorg.bedework.system.ports.offset=0 |
|---|
| 104 |
|
|---|
| 105 |
# standard ports + defined value |
|---|
| 106 |
#JBOSS_PORTS="-Dorg.bedework.system.ports.offset=505 -Djboss.service.binding.set=ports-syspar" |
|---|
| 107 |
|
|---|
| 108 |
ACTIVEMQ_DIRPREFIX="-Dorg.apache.activemq.default.directory.prefix=$JBOSS_DATA_DIR/" |
|---|
| 109 |
|
|---|
| 110 |
BW_DATA_DIR=$JBOSS_DATA_DIR/bedework |
|---|
| 111 |
BW_DATA_DIR_DEF=-Dorg.bedework.data.dir=$BW_DATA_DIR/ |
|---|
| 112 |
|
|---|
| 113 |
JAVA_OPTS="$JAVA_OPTS -Xms$heap -Xmx$heap" |
|---|
| 114 |
JAVA_OPTS="$JAVA_OPTS -XX:NewSize=$newsize -XX:MaxNewSize=$newsize" |
|---|
| 115 |
export JAVA_OPTS="$JAVA_OPTS -XX:PermSize=$permsize -XX:MaxPermSize=$permsize" |
|---|
| 116 |
|
|---|
| 117 |
RUN_CMD="./$JBOSS_VERSION/bin/run.sh -c $JBOSS_CONFIG $JBOSS_BIND $JBOSS_PORTS $LOG_THRESHOLD $LOG_LEVELS $ACTIVEMQ_DIRPREFIX $BW_DATA_DIR_DEF" |
|---|
| 118 |
|
|---|
| 119 |
echo $RUN_CMD |
|---|
| 120 |
|
|---|
| 121 |
$RUN_CMD |
|---|
| 122 |
|
|---|