summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-05-22 20:41:15 +0000
committer(no author) <(no author)@6c8d7289-2bf4-0310-a012-ef5d649a1542>2007-05-22 20:41:15 +0000
commitb4b56a54754f6e55c0bc0e0961ab5022bbf64ecd (patch)
treeeba98ba6d9125e7f01ed8216f4278dfa49568112
parenta585b4d41b5136dac1e8a04df3c79c62da80ac5f (diff)
*) 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
-rw-r--r--htroot/Status.java5
-rw-r--r--htroot/Steering.java16
-rw-r--r--startYACY.bat4
3 files changed, 17 insertions, 8 deletions
diff --git a/htroot/Status.java b/htroot/Status.java
index 48ff06f18..6e235aee5 100644
--- a/htroot/Status.java
+++ b/htroot/Status.java
@@ -145,8 +145,9 @@ public class Status {
// if running on Windows, enable restart button
// (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
prop.put("versionpp", yacy.combined2prettyVersion(sb.getConfig("version","0.1")));
diff --git a/htroot/Steering.java b/htroot/Steering.java
index 0ad7281f7..f2ee48a80 100644
--- a/htroot/Steering.java
+++ b/htroot/Steering.java
@@ -46,8 +46,6 @@
// javac -classpath .:../Classes SettingsAck_p.java
// if the shell's current path is HTROOT
-import java.io.File;
-import java.io.IOException;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
@@ -72,12 +70,14 @@ public class Steering {
}
if (post.containsKey("shutdown")) {
+ if (sb.updaterCallback != null) { sb.updaterCallback.signalYaCyShutdown(); }
sb.terminate(3000);
prop.put("info", 3);
return prop;
}
if (post.containsKey("restart")) {
+ /*
// yacy.restart erstellen (wird im startscript ausgewertet)
final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart");
if (!yacyRestart.exists()) {
@@ -88,12 +88,20 @@ public class Steering {
e.printStackTrace();
}
}
- sb.terminate(5000);
+ */
+ if (sb.updaterCallback != null) {
+ sb.updaterCallback.signalYaCyRestart();
+ } else {
+ serverLog.logWarning("SHUTDOWN", "ERROR: no wrapper/updater running! Performing a normal shutdown...");
+ }
+
+ sb.terminate(5000);
prop.put("info", 4);
+
return prop;
}
return prop;
}
-} \ No newline at end of file
+}
diff --git a/startYACY.bat b/startYACY.bat
index 97b78684e..2066c744f 100644
--- a/startYACY.bat
+++ b/startYACY.bat
@@ -22,10 +22,10 @@ Echo Generated classpath:%CLASSPATH%
Echo JRE Parameters:%javacmd%
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 **** 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) **
Echo ** STOP YaCy: execute stopYACY.bat and wait some seconds **
Echo ** GET HELP for YaCy: see www.yacy-websearch.net/wiki and www.yacy-forum.de **
Echo *******************************************************************************