simplify supervised vs. standalone mode detection; also fix the docs

This commit is contained in:
George Danchev
2012-04-21 15:41:45 +00:00
parent 877862304a
commit ed7cf4c6a7
3 changed files with 18 additions and 29 deletions

View File

@ -9,34 +9,20 @@ CLEANUP=1
SPECIFIC_HELP=0
START_DIR_DONT_CHANGE=`pwd`
GEN_DATA_DIR=releng_generated_data/${SELF}
RELENG_STANDALONE=-1
RELENG_PARENT=unknown_parent
#############################################
standalone_or_supervised() {
which ps >/dev/null 2>&1
ret="$?"
case "$ret" in
0)
RELENG_PARENT=`ps -p $PPID -o comm=`
if test x"$RELENG_PARENT" = x"run_all_auto"
then
echo "${SELF}: Running in Supervised mode by ${RELENG_PARENT}"
RELENG_STANDALONE=0
else
echo "${SELF}: Running in Standalone mode"
RELENG_STANDALONE=1
fi
case "${RELENG_SCRIPT_RUN_BY_RUN_ALL_AUTO}" in
1)
echo "${SELF}: Running in Supervised mode"
;;
*)
echo "${SELF}: Running in Unknown mode by ${RELENG_PARENT}"
echo "${SELF}: Running in Standalone mode"
;;
esac
esac
}
# Unconditionally initialize the invocation mode - standalone or supervised
# Unconditionally shout out the invocation mode - standalone or supervised
standalone_or_supervised
#############################################