提交 0fa2fe64 编写于 作者: S Shoaib Lari 提交者: Kalen Krempely

gpinitsystem: Return 1 if gpstop returns non-zero return code

gpinitsystem examines the return code from gpstop, and if a non-zero return code
is returned from gpstop, then gpinitsystem exits with return code 1.
Co-authored-by: NMark Sliva <msliva@pivotal.io>
上级 1b66a99f
......@@ -1462,17 +1462,17 @@ STOP_QD_PRODUCTION () {
LOG_MSG "[INFO]:-Start Function $FUNCNAME"
LOG_MSG "[INFO]:-Restarting the Greenplum instance in production mode" 1
if [ -f $GPSTOP ]; then
GPSTOP_OPTS=$(OUTPUT_LEVEL_OPTS)
export MASTER_DATA_DIRECTORY=${MASTER_DIRECTORY}/${SEG_PREFIX}-1
$GPSTOP -a -l $LOG_DIR -m -d $MASTER_DATA_DIRECTORY $GPSTOP_OPTS
RETVAL=$?
case $RETVAL in
0 ) LOG_MSG "[INFO]:-Successfully shutdown the new Greenplum instance" ;;
1 ) LOG_MSG "[WARN]:-Non fatal error from Greenplum instance shutdown, check log files, will continue" ;;
* ) ERROR_EXIT "[FATAL]:-Failed to stop new Greenplum instance, check log file"
esac
GPSTOP_OPTS=$(OUTPUT_LEVEL_OPTS)
export MASTER_DATA_DIRECTORY=${MASTER_DIRECTORY}/${SEG_PREFIX}-1
$GPSTOP -a -l $LOG_DIR -m -d $MASTER_DATA_DIRECTORY $GPSTOP_OPTS
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
LOG_MSG "[INFO]:-Successfully shutdown the new Greenplum instance"
else
ERROR_EXIT "[FATAL]:-Error from Greenplum instance shutdown, check log files"
fi
else
ERROR_EXIT "[FATAL]:-$GPSTOP not located"
ERROR_EXIT "[FATAL]:-$GPSTOP not located"
fi
LOG_MSG "[INFO]:-End Function $FUNCNAME"
}
......@@ -1536,11 +1536,11 @@ START_QD_PRODUCTION () {
$GPSTOP -a -l $LOG_DIR -i -d $MASTER_DATA_DIRECTORY $GPSTOP_OPTS
RETVAL=$?
case $RETVAL in
0 ) LOG_MSG "[INFO]:-Successfully shutdown the Greenplum instance" 1;;
1 ) LOG_MSG "[WARN]:-Non fatal error from Greenplum instance shutdown" 1;;
* ) ERROR_EXIT "[WARN]:-Failed to stop new Greenplum instance"
esac
if [ $RETVAL -eq 0 ]; then
LOG_MSG "[INFO]:-Successfully shutdown the Greenplum instance" 1
else
ERROR_EXIT "[FATAL]:-Error from Greenplum instance shutdown, check log files"
fi
else
LOG_MSG "[WARN]:-$GPSTOP not located" 1
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册