Low tech solution: make four copies of run.sh (and possibly run.conf) and set the memory in each one.
High tech solution: I assume that each server is a separate configuration (that is, 'run.sh -c config1'), so you can modify the scripts to base the memory size on the configuration passed to the script.
Is there a way to pass the run.conf location to the run.sh on the fly? Then I could just specify multiple run.conf files and let the configuration know which one to use.
I am not a shell script expert, but offhand I would say it is possible.
We are using something like that:
1. start jboss with run.sh start myserver
JAVA_OPTS="$JAVA_OPTS -server -Xms2000m -Xmx2000m ...."
# --- Read an optional running configuration file if [ "x$2" = "x" ]; then RUN_CONF="$DIRNAME/run.conf" else RUN_CONF="$DIRNAME/run.$2.conf" fi if [ -r $RUN_CONF ]; then . $RUN_CONF fi echo "using configuration file: $RUN_CONF"
Thank you very much. Simple approach that works perfectly.
We have now the following error durinx execution run.sh:
run.sh: unused non-option argument: "Server_name"
Do you have the same one?