Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-17246 Logging improvements in frunssh and thor #9826

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions common/remote/rmtssh.cpp
Expand Up @@ -514,7 +514,10 @@ class CFRunSSH: public CInterface, implements IFRunSSH
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)
Expand All @@ -524,8 +527,12 @@ class CFRunSSH: public CInterface, implements IFRunSSH
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(
Expand Down
2 changes: 2 additions & 0 deletions initfiles/bash/etc/init.d/dafilesrv.in
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions initfiles/bash/etc/init.d/hpcc-init.in
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions initfiles/bin/init_thor.in
Expand Up @@ -89,8 +89,6 @@ kill_slaves()
else
log "Frunssh successful"
fi
else
log "Could not locate $instancedir/uslaves file"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion initfiles/bin/init_thorslave.in
Expand Up @@ -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=$?
Expand Down
3 changes: 2 additions & 1 deletion services/runagent/frunssh.cpp
Expand Up @@ -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)
Expand Down