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.
@@ -1466,11 +1466,11 @@ STOP_QD_PRODUCTION () {
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
+ 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"
fi
@@ -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
