String command = runAsRoot ? execAsRoot(statement.render(OsFamily.UNIX)) : execScriptAsDefaultUser(statement
.render(OsFamily.UNIX));
try {
returnVal = runCommand(command);
} catch (Throwable e) {
eventBus.post(new StatementOnNodeFailure(statement, node, e));
throw Throwables.propagate(e);
}
eventBus.post(new StatementOnNodeCompletion(statement, node, returnVal));
if (logger.isTraceEnabled())
logger.trace("<< %s[%s]", statement, returnVal);