Omaha #3508 - purge non-centralized yajsw distributions

amend: ensure edex is dependent on yajsw

Change-Id: I31ecdaa27d6bffbcd52ff69a413ea87190e9ea55

Former-commit-id: 0894efaaa3 [formerly 9b36754ca610887a17666ceff2a1540b958913b6]
Former-commit-id: 71cf313666
This commit is contained in:
Bryan Kowal 2014-12-04 17:09:43 -06:00
parent 26b92860af
commit cf5353e368
19 changed files with 15 additions and 188 deletions

View file

@ -45,6 +45,13 @@ if [ -z "${SKIP_RPM_CHECK}" ]; then
echo "Unable To Continue ... Terminating."
exit 1
fi
rpm -q awips2-yajsw > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: awips2-yajsw Must Be Installed."
echo "Unable To Continue ... Terminating."
exit 1
fi
fi
path_to_script=`readlink -f $0`
@ -58,6 +65,7 @@ awips_home=$(dirname $EDEX_HOME)
if [ -z "$PYTHON_INSTALL" ]; then PYTHON_INSTALL="$awips_home/python"; fi
if [ -z "$JAVA_INSTALL" ]; then JAVA_INSTALL="$awips_home/java"; fi
if [ -z "$PSQL_INSTALL" ]; then PSQL_INSTALL="$awips_home/psql"; fi
if [ -z "$YAJSW_HOME" ]; then YAJSW_HOME="$awips_home/yajsw"; fi
# Source The File With The Localization Information
source ${dir}/setup.env
@ -150,4 +158,4 @@ if [ $DEBUG_FLAG == "on" ]; then
echo "To Debug ... Connect to Port: ${EDEX_DEBUG_PORT}."
fi
java -Xmx32m -XX:MaxPermSize=12m -XX:ReservedCodeCacheSize=4m -jar ${EDEX_HOME}/bin/yajsw/wrapper.jar -c ${EDEX_HOME}/conf/${CONF_FILE} ${WRAPPER_ARGS}
java -Xmx32m -XX:MaxPermSize=12m -XX:ReservedCodeCacheSize=4m -jar ${YAJSW_HOME}/wrapper.jar -c ${EDEX_HOME}/conf/${CONF_FILE} ${WRAPPER_ARGS}

View file

@ -1,180 +0,0 @@
#!/bin/sh
#####################################################################
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
#####################################################################
#####################################################################
# Script for capturing data from a wrapper java process when the
# wrapper restarts the process
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------- -------- ----------- --------------------------
# Aug 07, 2014 3470 rjpeter Initial creation
#
#####################################################################
# NOTE: Script must be located at /awips2/qpid/bin/yajsw/scripts for it to work
# base path to save capture data to, will create subdirectory for each server
basePath="/data/fxa/cave"
state=$1
string_state=$2
pid=$4
path_to_script=`readlink -f $0`
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: Wrapper running $path_to_script due to state transition for pid $pid. New State $state|$string_state"
# ensure directory is created and has write permissions
checkDir() {
dir="$1"
if [ ! -d "$dir" ]; then
mkdir -p $dir
if [ ! -d "$dir" ]; then
message="Unable to create qpid capture data directory\n$dir"
echo -e "Capture failed: $message"
exit 1
fi
fi
if [ ! -w "$dir" ]; then
message="Do not have write permissions to qpid capture data directory\n$dir"
echo -e "Capture failed: $message"
exit 1
fi
}
# gets top output of local server
runTop() {
local curTime=`date "+%Y%m%d_%H:%M:%S"`
echo "$curTime: Capturing top"
echo "$curTime: Capturing top" >> $processFile
local out_file="${dataPath}/top.log"
export COLUMNS=160
top -b -c -n1 >> $out_file 2>&1
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: top captured"
}
# runs jstack 10 times, if it fails will run again with -F
runJstack() {
local curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: Capturing jstacks"
local pid="$1"
local count=1
local cmd="/awips2/java/bin/jstack"
local prePath="${dataPath}/pid_${pid}_"
local log=""
while [ "$count" -le "10" ]; do
curTime=`date "+%Y%m%d_%H:%M:%S"`
log="${prePath}jstack_${count}.log"
echo "${curTime}: Running command: ${cmd} ${pid} >> ${log} 2>&1" >> $processFile
echo "Running for $curTime" >> $log
${cmd} ${pid} >> ${log} 2>&1
if [[ "$?" != "0" && $FORCE != "y" ]]; then
curTime=`date "+%Y%m%d_%H:%M:%S"`
echo "${curTime}: jstack for $pid failed to connect, rerunning with -F" >> $processFile
${cmd} -F ${pid} >> ${log} 2>&1
fi
let "count+=1"
done
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: jstacks captured"
}
# runs jmap -heap
runJmapHeap() {
local curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: Capturing jmap -heap"
local pid=$1
local prePath="${dataPath}/pid_${pid}_"
local log="${prePath}jmapHeap.log"
local cmd="/awips2/java/bin/jmap -heap"
echo "${curTime}: Running command: $cmd $pid >> $log 2>&1" >> $processFile
$cmd $pid >> $log 2>&1
if [[ "$?" != "0" && $FORCE != "y" ]]; then
curTime=`date "+%Y%m%d_%H:%M:%S"`
echo "${curTime}: jmap for $pid failed to connect, rerunning with -F" >> $processFile
$cmd -F $pid >> $log 2>&1
fi
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: jmap -heap captured"
}
# runs jmap, if it fails will run again with -F
runJmap() {
local curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: Capturing jmap -dump"
local pid=$1
local prePath="${dataPath}/pid_${pid}_jmap"
local log="${prePath}.log"
local dumpPath="${prePath}.hprof"
local cmd="/awips2/java/bin/jmap -dump:format=b,file=${dumpPath}"
echo "${curTime}: Running command: $cmd $pid >> $log 2>&1" >> $processFile
$cmd $pid >> $log 2>&1
if [[ "$?" != "0" && $FORCE != "y" ]]; then
curTime=`date "+%Y%m%d_%H:%M:%S"`
echo "${curTime}: jmap for $pid failed to connect, rerunning with -F" >> $processFile
$cmd -F $pid >> $log 2>&1
fi
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: jmap -dump captured"
}
if [[ "$pid" != "-1" ]]; then
process=`ps -ef | grep $pid | grep java`
if [[ "$process" != "" ]]; then
hostName=`hostname -s`
dataPath="${basePath}/${hostName}/wrapperCaptureData_${curTime}_pid_$pid"
checkDir $dataPath
processFile=${dataPath}/capture_info.log
echo "Wrapper running $0 due to state transition for pid $pid. New State $state|$string_state" >> $processFile
echo "Process information:" >> $processFile
ps -ef | grep $pid >> $processFile
runTop &
runJstack $pid &
runJmapHeap $pid &
# TODO: Double check if jvm already dumped one
runJmap $pid &
wait
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: Data captured to $dataPath"
else
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: PID $pid is no longer running, nothing to capture"
fi
else
curTime=`date +%Y%m%d_%H%M%S`
echo "$curTime: PID was -1, process no longer running, nothing to capture"
fi

View file

@ -42,13 +42,11 @@ 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
wrapper.java.classpath.2=${EDEX_HOME}/conf/
wrapper.java.classpath.3=${EDEX_HOME}/conf/cache/
wrapper.java.classpath.4=${EDEX_HOME}/conf/spring/
wrapper.java.classpath.5=${EDEX_HOME}/conf/resources/
# Java Classpath. Add class path elements as needed starting from 1.
wrapper.java.classpath.1=${EDEX_HOME}/conf/
wrapper.java.classpath.2=${EDEX_HOME}/conf/cache/
wrapper.java.classpath.3=${EDEX_HOME}/conf/spring/
wrapper.java.classpath.4=${EDEX_HOME}/conf/resources/
# include ANY jar files that are found in the locations denoted by
# wrapper.search.java.classpath.#

View file

@ -19,6 +19,7 @@ provides: awips2-base
requires: awips2-python
requires: awips2-java
requires: awips2-psql
requires: awips2-yajsw
%description
AWIPS II Edex Installation - Installs and configures AWIPS II Edex.