浏览代码

HPCC-17123 Added descriptive error message and fixed init_thorslave call

Signed-off-by: Michael Gardner <michael.gardner@lexisnexis.com>
Michael Gardner 8 年之前
父节点
当前提交
337f7db532
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5 1
      initfiles/bash/etc/init.d/init-functions
  2. 1 1
      initfiles/bin/init_thor.in

+ 5 - 1
initfiles/bash/etc/init.d/init-functions

@@ -209,7 +209,11 @@ log() {
   local msg=$@
   local header=$( date +%Y_%m_%d_%H_%M_%S )
   local header="${header}: "
-  printf "%s%s\n" "$header" "$msg" >> $logfile
+  (printf "%s%s\n" "$header" "$msg" >> $logfile) 2> /dev/null
+  if [[ $? -ne 0 ]]; then
+    echo "unable to write to ${logfile}" 1>&2
+    return 1
+  fi
 
   return 0
 }

+ 1 - 1
initfiles/bin/init_thor.in

@@ -75,7 +75,7 @@ kill_slaves()
         # we want to kill only slaves that have already been started in run_thor
         if [[ -r $instancedir/uslaves ]]; then
             clusternodes=$(cat $instancedir/uslaves 2> /dev/null | wc -l)
-            $deploydir/frunssh $instancedir/uslaves "/bin/sh -c '$deploydir/init_thorslave stop localhost $slavespernode $THORSLAVEPORT $slaveportinc $THORMASTER $THORMASTERPORT $LOG_DIR $instancedir $deploydir $THORNAME $PATH_PRE $logredirect'" -i:$SSHidentityfile -u:$SSHusername -pe:$SSHpassword -t:$SSHtimeout -a:$SSHretries -n:$clusternodes 2>&1
+            $deploydir/frunssh $instancedir/uslaves "/bin/sh -c '$deploydir/init_thorslave stop localhost $slavespernode $THORSLAVEPORT $slaveportinc $THORMASTER $THORMASTERPORT $LOG_DIR $instancedir $deploydir $THORNAME ${INSTALL_DIR}/sbin $logredirect'" -i:$SSHidentityfile -u:$SSHusername -pe:$SSHpassword -t:$SSHtimeout -a:$SSHretries -n:$clusternodes 2>&1
             FRUNSSH_RC=$?
             if [[ ${FRUNSSH_RC} -gt 0 ]]; then
                 log "Error ${FRUNSSH_RC} in frunssh"