|
|
|
@ -283,7 +283,23 @@ public final class yacyVersion implements Comparator, Comparable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (serverSystem.canExecUnix) {
|
|
|
|
|
// start a re-start daemon
|
|
|
|
|
try {
|
|
|
|
|
serverLog.logInfo("RESTART", "INITIATED");
|
|
|
|
|
String script = "cd " + plasmaSwitchboard.getSwitchboard().getRootPath() + "/DATA/RELEASE/;while [ -e ../yacy.running ]; do sleep 1;done;cd ../../;./startYACY.sh";
|
|
|
|
|
File scriptFile = new File(plasmaSwitchboard.getSwitchboard().getRootPath(), "DATA/RELEASE/restart.sh");
|
|
|
|
|
serverSystem.deployScript(scriptFile, script);
|
|
|
|
|
serverLog.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
|
|
|
|
|
serverSystem.execAsynchronous(scriptFile);
|
|
|
|
|
serverLog.logInfo("RESTART", "script is running");
|
|
|
|
|
plasmaSwitchboard.getSwitchboard().terminate(5000);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
serverLog.logSevere("RESTART", "restart failed", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
if (serverSystem.canExecUnix) {
|
|
|
|
|
// start a re-start daemon
|
|
|
|
|
try {
|
|
|
|
@ -293,13 +309,7 @@ public final class yacyVersion implements Comparator, Comparable {
|
|
|
|
|
serverFileUtils.write(script.getBytes(), scriptFile);
|
|
|
|
|
serverLog.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
|
|
|
|
|
Runtime.getRuntime().exec("chmod 755 " + scriptFile.getAbsolutePath()).waitFor();
|
|
|
|
|
/*Process p =*/ Runtime.getRuntime().exec(scriptFile.getAbsolutePath() + " &");
|
|
|
|
|
/*serverLog.logInfo("RESTART", "script started");
|
|
|
|
|
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
|
|
|
|
|
String text;
|
|
|
|
|
while ((text = in.readLine()) != null) {
|
|
|
|
|
serverLog.logInfo("RESTART", " SCRIPT-LOG " + text);
|
|
|
|
|
}*/
|
|
|
|
|
Runtime.getRuntime().exec(scriptFile.getAbsolutePath() + " &");
|
|
|
|
|
serverLog.logInfo("RESTART", "script is running");
|
|
|
|
|
plasmaSwitchboard.getSwitchboard().terminate(5000);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
@ -308,6 +318,7 @@ public final class yacyVersion implements Comparator, Comparable {
|
|
|
|
|
serverLog.logSevere("RESTART", "restart failed", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|