timeoutValue = Long.parseLong(timeout);
} catch (NumberFormatException e) {
// OK to use 0
}
}
ExternalCommand externalCmd = ExternalCommand.executeWithTimeout(new File(workingDir),
cmdValue, timeoutValue, args);
// debug
// System.out.println("command output:\n" + externalCmd.getStringOutput());
int exitValue = externalCmd.exitValue();
_logger.info("Executed command: " + cmd + ", exitValue: " + exitValue);
// if exit-value != 0, transition fails
if (exitValue != 0) {
throw new Exception("fail to execute command: " + cmd + ", exitValue: " + exitValue
+ ", error: " + externalCmd.getStringError());
}
// monitor pid if pidFile exists
if (pidFile == null) {
// no pid to monitor