private void runCommand ( TaskCommands taskCommand , String user , List < String > cmdArgs , File workDir , Map < String , String > env ) throws IOException { ShellCommandExecutor shExec = buildTaskControllerExecutor ( taskCommand , user , cmdArgs , workDir , env ) ; try { shExec . execute ( ) ; } catch ( Exception e ) { LOG . warn ( "Exit code from " + taskCommand . toString ( ) + " is : " + shExec . getExitCode ( ) ) ; LOG . warn ( "Exception thrown by " + taskCommand . toString ( ) + " : " + StringUtils . stringifyException ( e ) ) ; LOG . info ( "Output from LinuxTaskController's " + taskCommand . toString ( ) + " follows:" ) ; logOutput ( shExec . getOutput ( ) ) ; throw new IOException ( e ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . info ( "Output from LinuxTaskController's " + taskCommand . toString ( ) + " follows:" ) ; logOutput ( shExec . getOutput ( ) ) ; } }
Helper method that runs a LinuxTaskController command