|
|
@ -124,10 +124,12 @@ public abstract class AbstractCommandExecutor { |
|
|
|
// merge error information to standard output stream
|
|
|
|
// merge error information to standard output stream
|
|
|
|
processBuilder.redirectErrorStream(true); |
|
|
|
processBuilder.redirectErrorStream(true); |
|
|
|
|
|
|
|
|
|
|
|
// setting up user to run commands
|
|
|
|
// if sudo.enable=true,setting up user to run commands
|
|
|
|
command.add("sudo"); |
|
|
|
if (OSUtils.isSudoEnable()) { |
|
|
|
command.add("-u"); |
|
|
|
command.add("sudo"); |
|
|
|
command.add(taskRequest.getTenantCode()); |
|
|
|
command.add("-u"); |
|
|
|
|
|
|
|
command.add(taskRequest.getTenantCode()); |
|
|
|
|
|
|
|
} |
|
|
|
command.add(commandInterpreter()); |
|
|
|
command.add(commandInterpreter()); |
|
|
|
command.addAll(Collections.emptyList()); |
|
|
|
command.addAll(Collections.emptyList()); |
|
|
|
command.add(commandFile); |
|
|
|
command.add(commandFile); |
|
|
|