private boolean startVm(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener,
ArgumentListBuilder args, Map<String, String> env) throws InterruptedException, IOException {
FilePath moduleRoot = build.getModuleRoot();
ScheduledFuture<?> future = null;
try {
Proc proc = launcher.launch().cmds(args).envs(env).stdout(listener).pwd(moduleRoot).start();
FilePath debugLog = this.getDebugLog(moduleRoot);
if (debugLog != null) {
Runnable watchdog = new WatdogTask(debugLog, proc, listener.getLogger());
future = EXECUTOR.scheduleAtFixedRate(watchdog, 500L, 500L, TimeUnit.MILLISECONDS);
}
int r = proc.join();
this.appendDebugLog(moduleRoot, listener);
return r == 0;
} catch (IOException e) {
this.appendDebugLog(moduleRoot, listener);
Util.displayIOException(e, listener);