Merge "Omaha #3363 fixed ini lookup precedence and improved loggin in cave.sh" into omaha_14.4.1
Former-commit-id: c114f3578804f9eb2fd130428bb327c968f0fbdf
This commit is contained in:
commit
f92d9eb817
2 changed files with 43 additions and 32 deletions
|
@ -30,6 +30,7 @@
|
|||
# around this script.
|
||||
# Jan 24, 2014 #2739 bsteffen Log exit status
|
||||
# Jan 30, 2014 #2593 bclement warns based on memory usage, fixed for INI files with spaces
|
||||
# Jul 10, 2014 #3363 bclement logs command used to launch application to console logs
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -240,10 +241,13 @@ curTime=`date +%Y%m%d_%H%M%S`
|
|||
nohup ${CAVE_INSTALL}/monitorThreads.sh $pid >> /dev/null 2>&1 &
|
||||
fi
|
||||
|
||||
echo "Launching cave application using the following command: " >> ${LOGFILE}
|
||||
echo "${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} ${USER_ARGS[@]}" >> ${LOGFILE}
|
||||
|
||||
if [[ "${redirect}" == "true" ]] ; then
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" > ${LOGFILE} 2>&1
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" >> ${LOGFILE} 2>&1
|
||||
else
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee ${LOGFILE}
|
||||
exec ${CAVE_INSTALL}/cave ${CAVE_INI_ARG} ${SWITCHES} "${USER_ARGS[@]}" 2>&1 | tee -a ${LOGFILE}
|
||||
fi
|
||||
) &
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
# Mar 13 2014 #15348 kjohnson added function to remove logs
|
||||
# Jun 20, 2014 #3245 bclement forEachRunningCave now accounts for child processes
|
||||
# Jul 02, 2014 #3245 bclement account for memory override in vm arguments
|
||||
# Jul 10, 2014 #3363 bclement fixed precedence order for ini file lookup
|
||||
|
||||
|
||||
source /awips2/cave/iniLookup.sh
|
||||
|
@ -50,40 +51,46 @@ BYTES_IN_KB=1024
|
|||
BYTES_IN_MB=1048576
|
||||
BYTES_IN_GB=1073741824
|
||||
|
||||
# Looks up ini file first by component/perspective
|
||||
# then by SITE_TYPE before falling back to cave.ini.
|
||||
# Sets ini file cave argument string in $CAVE_INI_ARG.
|
||||
# Returns 0 if component/perspective found in args, else 1.
|
||||
function lookupINI()
|
||||
{
|
||||
# Arguments:
|
||||
#
|
||||
if [ "${1}" == "" ]; then
|
||||
return 1
|
||||
# only check for component/perspective if arguments aren't empty
|
||||
if [[ "${1}" != "" ]]; then
|
||||
position=1
|
||||
for arg in $@; do
|
||||
if [ "${arg}" == "-component" ] ||
|
||||
[ "${arg}" == "-perspective" ]; then
|
||||
# Get The Next Argument.
|
||||
position=$(( $position + 1 ))
|
||||
nextArg=${!position}
|
||||
|
||||
retrieveAssociatedINI ${arg} "${nextArg}"
|
||||
RC=$?
|
||||
if [ ${RC} -eq 0 ]; then
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/${ASSOCIATED_INI}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
position=$(( $position + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
position=1
|
||||
for arg in $@; do
|
||||
if [ "${arg}" == "-component" ] ||
|
||||
[ "${arg}" == "-perspective" ]; then
|
||||
# Get The Next Argument.
|
||||
position=$(( $position + 1 ))
|
||||
nextArg=${!position}
|
||||
|
||||
retrieveAssociatedINI ${arg} "${nextArg}"
|
||||
RC=$?
|
||||
if [ ${RC} -eq 0 ]; then
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/${ASSOCIATED_INI}"
|
||||
else
|
||||
siteTypeIni="/awips2/cave/${SITE_TYPE}.ini"
|
||||
if [[ -e ${siteTypeIni} ]]
|
||||
then
|
||||
export CAVE_INI_ARG="--launcher.ini ${siteTypeIni}"
|
||||
else
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini"
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
position=$(( $position + 1 ))
|
||||
done
|
||||
|
||||
# if ini wasn't found through component or perspective
|
||||
if [[ -z $CAVE_INI_ARG ]]
|
||||
then
|
||||
# attempt to fall back to site type specific ini
|
||||
siteTypeIni="/awips2/cave/${SITE_TYPE}.ini"
|
||||
if [[ -e ${siteTypeIni} ]]
|
||||
then
|
||||
export CAVE_INI_ARG="--launcher.ini ${siteTypeIni}"
|
||||
else
|
||||
# cave.ini if all else fails
|
||||
export CAVE_INI_ARG="--launcher.ini /awips2/cave/cave.ini"
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue