Redirect the error to log message
Earlier the error was sent to /dev/null and the information was lost
displaying the cause of the error. Redirect the error to log file.
@@ -1233,7 +1233,7 @@ CREATE_QD_DB () {
BUILD_GPSSH_CONF $GP_DIR
LOG_MSG "[INFO]:-Starting the Master in admin mode" 1
export PGPORT=$GP_PORT;$PG_CTL -w -l $GP_DIR/log/startup.log -D $GP_DIR -o "-i -p $GP_PORT -c gp_role=utility \
- -m" start >> /dev/null 2>&1
+ -m" start >> ${LOG_FILE} 2>&1
RET_TEXT="`$PG_CTL status -D $GP_DIR`"
RUNNING=`$ECHO $RET_TEXT|$EGREP -c "not running|neither"`
if [ $RUNNING -ne 0 ]; then
@@ -1271,7 +1271,7 @@ UPDATE_GPCONFIG () {
U_ROLE=$8
U_DB=$DEFAULTDB
- CHK_COUNT=`env PGOPTIONS="-c gp_role=utility" $PSQL -p $MASTER_PORT -d "$U_DB" -X -A -t -c "SELECT count(*) FROM $GP_CONFIG_TBL WHERE content=${U_CONTENT} AND preferred_role='${U_ROLE}';" 2>/dev/null` >> $LOG_FILE 2>&1
+ CHK_COUNT=`env PGOPTIONS="-c gp_role=utility" $PSQL -p $MASTER_PORT -d "$U_DB" -X -A -t -c "SELECT count(*) FROM $GP_CONFIG_TBL WHERE content=${U_CONTENT} AND preferred_role='${U_ROLE}';" 2>>${LOG_FILE}` >> $LOG_FILE 2>&1
ERROR_CHK $? "obtain psql count Master $GP_CONFIG_TBL" 2
if [ $CHK_COUNT -eq 0 ]; then
LOG_MSG "[INFO]:-Adding $U_CONTENT on $U_HOSTNAME, path $U_DIR to Master gp_segment_configuration"
@@ -1386,7 +1386,7 @@ REGISTER_MIRRORS () {
for I in "${QE_MIRROR_ARRAY_SORTED_ON_CONTENT_ID[@]}"
do
SET_VAR $I
- dbid=`env PGOPTIONS="-c gp_role=utility" $PSQL -p $MASTER_PORT -d "${DEFAULTDB}" -X -A -t -c "select pg_catalog.gp_add_segment_mirror(${GP_CONTENT}::int2, '${GP_HOSTNAME}', '${GP_HOSTADDRESS}', ${GP_PORT}, '${GP_DIR}');" 2>/dev/null` >> $LOG_FILE 2>&1
+ dbid=`env PGOPTIONS="-c gp_role=utility" $PSQL -p $MASTER_PORT -d "${DEFAULTDB}" -X -A -t -c "select pg_catalog.gp_add_segment_mirror(${GP_CONTENT}::int2, '${GP_HOSTNAME}', '${GP_HOSTADDRESS}', ${GP_PORT}, '${GP_DIR}');" 2>>${LOG_FILE}` >> $LOG_FILE 2>&1
ERROR_CHK $? "failed to register mirror for contentid=${GP_CONTENT}" 2
MIRRORS_UPDATED_DBID=(${MIRRORS_UPDATED_DBID[@]} ${GP_HOSTNAME}~${GP_HOSTADDRESS}~${GP_PORT}~${GP_DIR}~${dbid}~${GP_CONTENT})
done
@@ -1524,7 +1524,7 @@ FORCE_FTS_PROBE () {
break
fi
- $PSQL -p $GP_PORT -d "$DEFAULTDB" -c "select gp_request_fts_probe_scan()" >> /dev/null 2>&1
+ $PSQL -p $GP_PORT -d "$DEFAULTDB" -c "select gp_request_fts_probe_scan()" >> ${LOG_FILE} 2>&1
done
LOG_MSG "[INFO]:-End Function $FUNCNAME"
}
