private void osExecute(String[] slaveNames, String cmd, ConnectionInfo connInfo) throws Exception {
try {
// if (Execute.isWindows()) cmd = "cmd " + cmd;
String[] args = ReplaceVariable.toArray(cmd, " ");
log.info("running for '" + SpecificDefault.toString(slaveNames) + "' for cmd '" + cmd + "'");
Execute execute = new Execute(args, null, this.initialCmdSleepDelay);
synchronized (this) {
if (slaveNames != null) {
for (int i=0; i < slaveNames.length; i++) {
String slaveName = slaveNames[i];
if (slaveName != null) {
Execute oldExecute = (Execute)this.runningExecutes.remove(slaveName);
if (oldExecute != null) {
log.warning("A new request for an initial update has come for '" + slaveName + "' but there is one already running. Will shut down the running one first");
oldExecute.stop();
log.info("old initial request for '" + slaveName + "' has been shut down");
this.runningExecutes.put(slaveName, execute);
}
}
}