*) Preparations for system-independent restart using the wrapper. Not functional yet.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3748 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
(no author) 18 years ago
parent a585b4d41b
commit b4b56a5475

@ -145,7 +145,8 @@ public class Status {
// if running on Windows, enable restart button // if running on Windows, enable restart button
// (remove from servlet when Linux start-script is capable, too) // (remove from servlet when Linux start-script is capable, too)
prop.put("restartEnabled", (System.getProperty("os.name").toLowerCase().startsWith("win")) ? 1 : 0); //prop.put("restartEnabled", (System.getProperty("os.name").toLowerCase().startsWith("win")) ? 1 : 0);
prop.put("restartEnabled", (sb.updaterCallback != null) ? 1 : 0);
// version information // version information
prop.put("versionpp", yacy.combined2prettyVersion(sb.getConfig("version","0.1"))); prop.put("versionpp", yacy.combined2prettyVersion(sb.getConfig("version","0.1")));

@ -46,8 +46,6 @@
// javac -classpath .:../Classes SettingsAck_p.java // javac -classpath .:../Classes SettingsAck_p.java
// if the shell's current path is HTROOT // if the shell's current path is HTROOT
import java.io.File;
import java.io.IOException;
import de.anomic.http.httpHeader; import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard; import de.anomic.plasma.plasmaSwitchboard;
@ -72,12 +70,14 @@ public class Steering {
} }
if (post.containsKey("shutdown")) { if (post.containsKey("shutdown")) {
if (sb.updaterCallback != null) { sb.updaterCallback.signalYaCyShutdown(); }
sb.terminate(3000); sb.terminate(3000);
prop.put("info", 3); prop.put("info", 3);
return prop; return prop;
} }
if (post.containsKey("restart")) { if (post.containsKey("restart")) {
/*
// yacy.restart erstellen (wird im startscript ausgewertet) // yacy.restart erstellen (wird im startscript ausgewertet)
final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart"); final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart");
if (!yacyRestart.exists()) { if (!yacyRestart.exists()) {
@ -88,8 +88,16 @@ public class Steering {
e.printStackTrace(); e.printStackTrace();
} }
} }
*/
if (sb.updaterCallback != null) {
sb.updaterCallback.signalYaCyRestart();
} else {
serverLog.logWarning("SHUTDOWN", "ERROR: no wrapper/updater running! Performing a normal shutdown...");
}
sb.terminate(5000); sb.terminate(5000);
prop.put("info", 4); prop.put("info", 4);
return prop; return prop;
} }

@ -22,7 +22,7 @@ Echo Generated classpath:%CLASSPATH%
Echo JRE Parameters:%javacmd% Echo JRE Parameters:%javacmd%
Echo Priority:%priority% Echo Priority:%priority%
Echo ****************** YaCy Web Crawler/Indexer ^& Search Engine ******************* Echo ****************** YaCy Web Crawler/Indexer ^& Search Engine ******************
Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 **** Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 ****
Echo **** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/yacy **** Echo **** USE AT YOUR OWN RISK! Project home and releases: http://yacy.net/yacy ****
Echo ** LOG of YaCy: DATA/LOG/yacy00.log (and yacy^<xx^>.log) ** Echo ** LOG of YaCy: DATA/LOG/yacy00.log (and yacy^<xx^>.log) **

Loading…
Cancel
Save