浏览代码

HPCC-17246 Logging improvements in frunssh and thor

Signed-off-by: Michael Gardner <michael.gardner@lexisnexis.com>
Michael Gardner 8 年之前
父节点
当前提交
3914058968

+ 10 - 3
common/remote/rmtssh.cpp

@@ -514,7 +514,10 @@ public:
                     res.setLength(res.length()-1);
                 if (reply.item(n)) {
                     errCode = reply.item(n);
-                    multiException->append(*MakeStringExceptionDirect(errCode,res.str()));
+                    if (res.length())
+                        multiException->append(*MakeStringExceptionDirect(errCode,res.str()));
+                    else
+                        multiException->append(*MakeStringExceptionDirect(errCode,cmd.str()));
                 }
             }
             if (errCode)
@@ -524,8 +527,12 @@ public:
             StringBuffer res(replytext.item(0));
             while (res.length()&&(res.charAt(res.length()-1)<=' '))
                 res.setLength(res.length()-1);
-            if (reply.item(0))
-                throw MakeStringExceptionDirect(reply.item(0), res.str());
+            if (reply.item(0)) {
+                if (res.length())
+                    throw MakeStringExceptionDirect(reply.item(0), res.str());
+                else
+                    throw MakeStringExceptionDirect(reply.item(0), cmd.str());
+            }
         }
     }
     void exec(

+ 2 - 0
initfiles/bash/etc/init.d/dafilesrv.in

@@ -34,9 +34,11 @@
 #                         chkconfig Parameters
 ##-----------------------------------------------------------------------------
 
+### BEGIN INIT INFO
 # chkconfig: 235 30 80
 # Description: Starts the HPCC processes
 # Provides: dafilesrv
+### END INIT INFO
 
 ##-----------------------------------------------------------------------------
 #                         General Purpose Functions

+ 2 - 0
initfiles/bash/etc/init.d/hpcc-init.in

@@ -33,10 +33,12 @@
 #                         chkconfig Parameters
 ##-----------------------------------------------------------------------------
 
+### BEGIN INIT INFO
 # chkconfig: 235 40 90
 # Description: Starts the HPCC processes
 # Provides: hpcc-init
 # Required-Start: dafilesrv
+### END INIT INFO
 
 ##-----------------------------------------------------------------------------
 #                         General Purpose Functions                           

+ 0 - 2
initfiles/bin/init_thor.in

@@ -89,8 +89,6 @@ kill_slaves()
             else
                 log "Frunssh successful"
             fi
-        else
-            log "Could not locate $instancedir/uslaves file"
         fi
     fi
 

+ 1 - 1
initfiles/bin/init_thorslave.in

@@ -45,7 +45,7 @@ stop_slaves()
     local isAlive=0
 
     log "Attempting to kill $slavename with SIGTERM"
-    killall -SIGTERM $slavename > /dev/null
+    killall -SIGTERM $slavename > /dev/null 2>&1
     while [[ $isAlive -eq 0 && $timer -gt 0 ]];do
         killall -0 $slavename > /dev/null 2>&1
         isAlive=$?

+ 2 - 1
services/runagent/frunssh.cpp

@@ -76,7 +76,8 @@ int main( int argc, char *argv[] )
                 buf.setLength(buf.length()-1);
                 buf.clip();
             }
-            PROGLOG("%d: ssh(%d): %s",i+1,unsArray.item(i),buf.str());
+            if (buf.length())
+                PROGLOG("%d: ssh(%d): %s",i+1,unsArray.item(i),buf.str());
         }
     }
     catch(IException *e)