Issue #2231 Make edex startup more configurable
* Allow for skipping the RPM check * Allow for using system java in wrapper instead of hard-coded /awips2/java * Allow for configuring wrapper process actions with system variables e.g. RESTART vs. SHUTDOWN on crash Change-Id: Icaa3b3e388013a8106db6e29fd999aa5824c72bc Former-commit-id:3bb1b03cb7
[formerlye056592ba9
] [formerly3bb1b03cb7
[formerlye056592ba9
] [formerly9515d45e9d
[formerly 7834360e8c56ac74b29a585eeda8c0387067250b]]] Former-commit-id:9515d45e9d
Former-commit-id:37ce990b54
[formerlyb9dda179a0
] Former-commit-id:eec23b6971
This commit is contained in:
parent
a229db50f0
commit
33693f1903
7 changed files with 63 additions and 46 deletions
|
@ -20,6 +20,7 @@
|
|||
##
|
||||
# edex startup script
|
||||
|
||||
if [ -z "${SKIP_RPM_CHECK}" ]; then
|
||||
# Verify that awips2-python and awips2-java are installed.
|
||||
rpm -q awips2-python > /dev/null 2>&1
|
||||
RC=$?
|
||||
|
@ -44,11 +45,7 @@ if [ ${RC} -ne 0 ]; then
|
|||
echo "Unable To Continue ... Terminating."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the locations of awips2-python and awips2-java.
|
||||
PYTHON_INSTALL="/awips2/python"
|
||||
JAVA_INSTALL="/awips2/java"
|
||||
PSQL_INSTALL="/awips2/psql"
|
||||
fi
|
||||
|
||||
path_to_script=`readlink -f $0`
|
||||
dir=$(dirname $path_to_script)
|
||||
|
@ -56,6 +53,11 @@ dir=$(dirname $path_to_script)
|
|||
export EDEX_HOME=$(dirname $dir)
|
||||
awips_home=$(dirname $EDEX_HOME)
|
||||
|
||||
# Find the locations of awips2-python and awips2-java.
|
||||
PYTHON_INSTALL="$awips_home/python"
|
||||
JAVA_INSTALL="$awips_home/java"
|
||||
PSQL_INSTALL="$awips_home/psql"
|
||||
|
||||
# Source The File With The Localization Information
|
||||
source ${dir}/setup.env
|
||||
|
||||
|
@ -80,8 +82,7 @@ export PATH=$PATH:$awips_home/GFESuite/bin:$awips_home/GFESuite/ServiceBackup/sc
|
|||
export PATH=$PATH:$PROJECT/bin
|
||||
|
||||
export JAVA_HOME="${JAVA_INSTALL}"
|
||||
export LD_LIBRARY_PATH=$EDEX_HOME/lib/native/linux32/awips1:${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:${PSQL_INSTALL}/lib:$PROJECT/sharedLib
|
||||
export LD_LIBRARY_PATH=/awips2/edex/lib/lib_illusion:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$EDEX_HOME/lib/lib_illusion:$EDEX_HOME/lib/native/linux32/awips1:${JAVA_INSTALL}/lib:${PYTHON_INSTALL}/lib:${PSQL_INSTALL}/lib:$PROJECT/sharedLib:$LD_LIBRARY_PATH
|
||||
|
||||
export LD_PRELOAD="libpython.so"
|
||||
export FXA_DATA=$EDEX_HOME/data/fxa
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -23,7 +23,7 @@
|
|||
|
||||
wrapper.debug=false
|
||||
set.default.EDEX_HOME=../..
|
||||
wrapper.working.dir=/awips2/edex/bin
|
||||
wrapper.working.dir=${EDEX_HOME}/bin
|
||||
# required due to java bug:
|
||||
# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4388188
|
||||
# not sure if the yajsw developers have any intention of
|
||||
|
@ -34,11 +34,14 @@ wrapper.fork_hack=true
|
|||
wrapper.console.pipestreams=true
|
||||
|
||||
# Java Application
|
||||
wrapper.java.command=/awips2/java/bin/java
|
||||
wrapper.java.command=${EDEX_HOME}/../java/bin/java
|
||||
|
||||
# necessary for etc/init.d/edex_camel
|
||||
wrapper.pidfile=${EDEX_HOME}/bin/${EDEX_RUN_MODE}.pid
|
||||
|
||||
# use system java instead of awips2 java
|
||||
wrapper.app.env.use.system.java=${WRAPPER_USE_SYSTEM_JAVA}
|
||||
|
||||
# Java Classpath (include wrapper.jar) Add class path elements as
|
||||
# needed starting from 1
|
||||
wrapper.java.classpath.1=${EDEX_HOME}/bin/yajsw/wrapper.jar
|
||||
|
@ -167,13 +170,13 @@ wrapper.java.monitor.heap.threshold.percent = 90
|
|||
|
||||
wrapper.java.monitor.deadlock = true
|
||||
# application will be restarted and a warning message will be logged
|
||||
wrapper.filter.action.deadlock.restart=RESTART
|
||||
wrapper.filter.action.deadlock.restart=${WRAPPER_DEADLOCK_ACTION}
|
||||
|
||||
# restart the application if it crashes
|
||||
wrapper.on_exit.default=RESTART
|
||||
wrapper.on_exit.default=${WRAPPER_ON_EXIT_ACTION}
|
||||
# restart the application if it runs out of memory
|
||||
wrapper.trigger.1=java.lang.OutOfMemoryError
|
||||
wrapper.trigger.action=RESTART
|
||||
wrapper.trigger.action=${WRAPPER_TRIGGER_ACTION}
|
||||
|
||||
#********************************************************************
|
||||
# Wrapper Logging Properties
|
||||
|
|
|
@ -42,3 +42,8 @@ export SERIALIZE_STREAM_MAX_SIZE_MB=6
|
|||
|
||||
export LOG_CONF=logback.xml
|
||||
export MGMT_PORT=9600
|
||||
|
||||
export WRAPPER_DEADLOCK_ACTION=RESTART
|
||||
export WRAPPER_ON_EXIT_ACTION=RESTART
|
||||
export WRAPPER_TRIGGER_ACTION=RESTART
|
||||
export WRAPPER_USE_SYSTEM_JAVA=false
|
||||
|
|
Binary file not shown.
|
@ -8,6 +8,7 @@ import java.net.URI;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.rzo.yajsw.boot.WrapperLoader;
|
||||
import org.rzo.yajsw.io.CyclicBufferFileInputStream;
|
||||
import org.rzo.yajsw.io.CyclicBufferFilePrintStream;
|
||||
|
@ -260,8 +261,16 @@ public class BSDProcess extends PosixProcess
|
|||
|
||||
private String getCurrentJava()
|
||||
{
|
||||
int myPid = OperatingSystem.instance().processManagerInstance().currentProcessId();
|
||||
Process myProcess = OperatingSystem.instance().processManagerInstance().getProcess(myPid);
|
||||
Boolean system_java = BooleanUtils.toBoolean(getEnvironmentAsMap().get(
|
||||
"use.system.java"));
|
||||
|
||||
String java = "/awips2/java/bin/java";
|
||||
|
||||
if (system_java) {
|
||||
int myPid = OperatingSystem.instance().processManagerInstance()
|
||||
.currentProcessId();
|
||||
Process myProcess = OperatingSystem.instance()
|
||||
.processManagerInstance().getProcess(myPid);
|
||||
String cmd = myProcess.getCommand();
|
||||
String jvm = null;
|
||||
if (cmd.startsWith("\""))
|
||||
|
@ -269,11 +278,10 @@ public class BSDProcess extends PosixProcess
|
|||
else
|
||||
jvm = cmd.substring(0, cmd.indexOf(" "));
|
||||
|
||||
/*
|
||||
* bkowal
|
||||
* Always return the AWIPS II Java.
|
||||
*/
|
||||
return "/awips2/java/bin/java";
|
||||
java = jvm;
|
||||
}
|
||||
|
||||
return java;
|
||||
}
|
||||
|
||||
public String getCommandInternal()
|
||||
|
|
Loading…
Add table
Reference in a new issue