logger.info(name + " Exec: " + cmd);
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
// any error message?
StreamGobbler errorGobbler = new
StreamGobbler(proc.getErrorStream(), name + " ERROR", logger);
// any output?
StreamGobbler outputGobbler = new
StreamGobbler(proc.getInputStream(), name + " OUTPUT", logger);
// kick them off
errorGobbler.start();
outputGobbler.start();
// any error???
int exitVal = proc.waitFor();
logger.info(name + " ExitValue: " + exitVal);
}