Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

tried to fix restart button

orbiterc5c268c43ebc
diff --git a/htroot/Steering.java b/htroot/Steering.java
index 1dd902926..459192ef3 100644
--- a/htroot/Steering.java
+++ b/htroot/Steering.java
@@ -46,8 +46,10 @@
// javac -classpath .:../Classes SettingsAck_p.java
// if the shell's current path is HTROOT
+import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
+import java.io.InputStreamReader;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaSwitchboard;
@@ -93,17 +95,14 @@ public class Steering {
} else if (serverSystem.canExecUnix) {
// start a re-start daemon
try {
- /*Process p =*/ Runtime.getRuntime().exec("/bin/sh " + sb.getRootPath() + "/restart.sh &");
- /*
+ Process p = Runtime.getRuntime().exec("source " + sb.getRootPath() + "/restart.sh " + sb.getRootPath() + " &");
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
- PrintWriter out = new PrintWriter(System.out);
String text;
while ((text = in.readLine()) != null) {
- out.println(text); out.flush();
+ sb.getLog().logInfo("RESTART -- " + text);
}
- */
} catch (IOException e) {
- e.printStackTrace();
+ sb.getLog().logSevere("restart failed", e);
}
}
sb.terminate(5000);
diff --git a/restart.sh b/restart.sh
index a3f07548a..274d8921f 100755
--- a/restart.sh
+++ b/restart.sh
@@ -4,7 +4,8 @@
# in case that YaCy is terminated with the restart option
# navigate into the own directory path
-cd `dirname $0`
+# the path is handed over upon start of this script
+cd $1
# waiting for shutdown
while [ -e DATA/yacy.running ]; do
@@ -12,4 +13,4 @@ sleep 1
done
# shutdown complete, start up yacy
-./startYaCy.sh
+./startYACY.sh
diff --git a/source/de/anomic/server/serverSystem.java b/source/de/anomic/server/serverSystem.java
index 3fa8d712a..a4e758af1 100644
--- a/source/de/anomic/server/serverSystem.java
+++ b/source/de/anomic/server/serverSystem.java
@@ -98,7 +98,7 @@ public final class serverSystem {
isMacArchitecture = ((systemOS == systemMacOSC) || (systemOS == systemMacOSX));
isUnixFS = ((systemOS == systemMacOSX) || (systemOS == systemUnix));
- canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows))));
+ canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows))));
// set up the MRJ Methods through reflection
if (isMacArchitecture) try {
diff --git a/source/yacy.java b/source/yacy.java
index b7bc7121b..e0df66104 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -246,9 +246,10 @@ public final class yacy {
System.out.println("could not find logging properties in homePath=" + homePath);
e.printStackTrace();
}
- serverLog.logConfig("STARTUP", "java version " + System.getProperty("java.version", "no-java-version"));
- serverLog.logConfig("STARTUP", "Application Root Path: " + homePath);
- serverLog.logConfig("STARTUP", "Time Zone: UTC" + serverDate.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis());
+ serverLog.logConfig("STARTUP", "Java version: " + System.getProperty("java.version", "no-java-version"));
+ serverLog.logConfig("STARTUP", "Operation system: " + System.getProperty("os.name","unknown"));
+ serverLog.logConfig("STARTUP", "Application root-ath: " + homePath);
+ serverLog.logConfig("STARTUP", "Time zone: UTC" + serverDate.UTCDiffString() + "; UTC+0000 is " + System.currentTimeMillis());
serverLog.logConfig("STARTUP", "Maximum file system path length: " + serverSystem.maxPathLength);
f = new File(homePath, "DATA/yacy.running");