diff --git a/src/bin/initdb/initdb.cpp b/src/bin/initdb/initdb.cpp index 93eadcfb1db3a5a7e23763e67d94c590ec99fc18..6cd38ddef9dca5f198f2139e4c4e1e97769d2abd 100644 --- a/src/bin/initdb/initdb.cpp +++ b/src/bin/initdb/initdb.cpp @@ -4663,7 +4663,7 @@ int main(int argc, char* argv[]) // dss device init if (dss_device_init(socketpath, enable_dss) != DSS_SUCCESS) { - write_stderr(_("failed to init dss device.\n")); + write_stderr(_("failed to init dss device, check logs under $DSS_HOME for more information.\n")); exit_nicely(); } diff --git a/src/gausskernel/ddes/script/dms_contrl.sh b/src/gausskernel/ddes/script/dms_contrl.sh index 2e59beb08b15c0e39b52f312db8d90486f78c4d9..8e2ec2a95ca532acd7b6c1f5712ce5688501df8e 100644 --- a/src/gausskernel/ddes/script/dms_contrl.sh +++ b/src/gausskernel/ddes/script/dms_contrl.sh @@ -6,6 +6,7 @@ curr_path=`dirname $(readlink -f $0)` curr_filename=`basename $(readlink -f $0)` os_user=`whoami` file_user=`ls -l ${curr_path}"/${curr_filename}" | awk '{print $3}'` +dms_log=/dev/null if [ ${file_user} != ${os_user} ]; then echo "Can't run ${curr_filename}, because it does not belong to the current user!" @@ -46,6 +47,7 @@ log() { time=`date "+%Y-%m-%d %H:%M:%S"` echo "$time $1" + echo "$time $1" >> $dms_log } assert_empty() @@ -108,6 +110,15 @@ function clear_script_log fi } +touch_logfile() +{ + log_file=$1 + if [ ! -f $log_file ] + then + touch $log_file + fi +} + check_log_file() { log_path=$1 @@ -116,22 +127,15 @@ check_log_file() # max log file size 16 * 1024 * 1024 MAX_LOG_SIZE=16777216 MAX_LOG_BACKUP=10 - log_file_size=$(ls -l ${log_file} |awk '{print $5}') if [ -f ${log_file} ];then + log_file_size=$(ls -l ${log_file} | awk '{print $5}') if [ ${log_file_size} -ge ${MAX_LOG_SIZE} ];then mv -f ${log_file} "${log_path}/${operation}-`date +%Y-%m-%d_%H%M%S`.log" 2>/dev/null clear_script_log "${log_path}" "${operation}-" $MAX_LOG_BACKUP fi fi -} - -touch_logfile() -{ - log_file=$1 - if [ ! -f $log_file ] - then - touch $log_file - fi + touch_logfile $log_file + chmod 600 $log_file } assert_nonempty 1 ${1} @@ -143,6 +147,9 @@ INSTANCE_ID=${2} GSDB_HOME=${3} CMD_PARAM=${4} +dms_log=${GSDB_HOME}/dms_control.log +check_log_file ${GSDB_HOME} $dms_log dms_control + if [ X${DSS_HOME} == X"" ] then log "ERROR! DSS_HOME cannot be null!" @@ -156,14 +163,6 @@ function Start() db_start_log=${GSDB_HOME}/DBstart.log check_log_file ${GSDB_HOME} $db_start_log DBstart - if [[ -z "${GSDB_HOME}" ]] - then - db_start_log=/dev/null - else - touch_logfile $db_start_log - chmod 600 $db_start_log - fi - dss_flag_file=instance_manual_start_$(expr $INSTANCE_ID + 20001 - 6001) if [[ -f $GAUSSHOME/bin/$dss_flag_file ]]; then