summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-03 23:08:43 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2010-09-03 23:08:43 +0000
commitb3f0d064447d968739e26db2c8b8c3517fa7e7ea (patch)
tree467807b2b07264ebddef55c144a82ffb79cbf71e
parentd4e4967e199cf333f20a8b788907468b83b7692f (diff)
fixed a problem with restarts in YaCy mac applications: the DATA directory path was not submitted when doing a restart. This solves the problem by:
- storing the startup properties when yacy is started - using the properties in the restart-script again. this transports also the DATA directory location as parameter of the -gui option that is used when the Mac version of YaCy is started git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7102 6c8d7289-2bf4-0310-a012-ef5d649a1542
-rw-r--r--source/de/anomic/yacy/yacyRelease.java8
-rw-r--r--source/net/yacy/yacy.java3
-rwxr-xr-xstartYACY.sh5
3 files changed, 10 insertions, 6 deletions
diff --git a/source/de/anomic/yacy/yacyRelease.java b/source/de/anomic/yacy/yacyRelease.java
index 213ff8a13..cbd207c73 100644
--- a/source/de/anomic/yacy/yacyRelease.java
+++ b/source/de/anomic/yacy/yacyRelease.java
@@ -71,6 +71,7 @@ public final class yacyRelease extends yacyVersion {
// for details see defaults/yacy.network.freeworld.unit
private static Map<yacyUpdateLocation, DevAndMainVersions> latestReleases = new ConcurrentHashMap<yacyUpdateLocation, DevAndMainVersions>();
public final static List<yacyUpdateLocation> latestReleaseLocations = new ArrayList<yacyUpdateLocation>(); // will be initialized with value in defaults/yacy.network.freeworld.unit
+ public static String startParameter = "";
private MultiProtocolURI url;
private File releaseFile;
@@ -394,7 +395,7 @@ public final class yacyRelease extends yacyVersion {
final File startType = new File(sb.getDataPath(), "DATA/yacy.noconsole".replace("/", File.separator));
String starterFile = "startYACY_debug.bat";
if (startType.exists()) starterFile = "startYACY.bat"; // startType noconsole
-
+ if (startParameter.startsWith("-gui")) starterFile += " " + startParameter;
try{
Log.logInfo("RESTART", "INITIATED");
final String script =
@@ -449,7 +450,7 @@ public final class yacyRelease extends yacyVersion {
"done" + serverCore.LF_STRING +
//"cd ../../" + serverCore.LF_STRING +
"cd " + sb.getAppPath() + serverCore.LF_STRING +
- "nohup ./startYACY.sh > /dev/null" + serverCore.LF_STRING;
+ "nohup ./startYACY.sh " + (startParameter.startsWith("-gui") ? startParameter : "") + " > /dev/null" + serverCore.LF_STRING;
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/restart.sh");
OS.deployScript(scriptFile, script);
Log.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
@@ -484,6 +485,7 @@ public final class yacyRelease extends yacyVersion {
final File startType = new File(sb.getDataPath(), "DATA/yacy.noconsole".replace("/", File.separator));
String starterFile = "startYACY_debug.bat";
if (startType.exists()) starterFile = "startYACY.bat"; // startType noconsole
+ if (startParameter.startsWith("-gui")) starterFile += " " + startParameter;
script =
"@echo off" + serverCore.LF_STRING +
"title YaCy updater" + serverCore.LF_STRING +
@@ -531,7 +533,7 @@ public final class yacyRelease extends yacyVersion {
"cd " + sb.getAppPath().toString() + serverCore.LF_STRING +
"chmod 755 *.sh" + serverCore.LF_STRING + // tarTools does not keep access/execute right
"chmod 755 bin/*.sh" + serverCore.LF_STRING +
- "nohup ./startYACY.sh > /dev/null" + serverCore.LF_STRING;
+ "nohup ./startYACY.sh " + (startParameter.startsWith("-gui") ? startParameter : "") + " > /dev/null" + serverCore.LF_STRING;
scriptFileName = "update.sh";
}
final File scriptFile = new File(sb.getDataPath(), "DATA/RELEASE/".replace("/", File.separator) + scriptFileName);
diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java
index 444c54f4d..403138291 100644
--- a/source/net/yacy/yacy.java
+++ b/source/net/yacy/yacy.java
@@ -977,7 +977,8 @@ public final class yacy {
System.setProperty("java.awt.headless", "true");
}
- System.out.print(">"); for (String a: args) System.out.print(a + " "); System.out.println();
+ String s = ""; for (String a: args) s += a + " ";
+ yacyRelease.startParameter = s.trim();
File applicationRoot = new File(System.getProperty("user.dir").replace('\\', '/'));
File dataRoot = applicationRoot;
diff --git a/startYACY.sh b/startYACY.sh
index e2e221b0c..ae22cf51d 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -95,8 +95,9 @@ for option in $options;do
-t|--tail-log)
TAILLOG=1
;;
- -g|--gui)
+ -gui)
GUI=1
+ isparameter=1
;;
esac #case option
else #parameter
@@ -179,7 +180,7 @@ CLASSPATH=".:htroot:$CLASSPATH"
cmdline="$JAVA $JAVA_ARGS -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8 -classpath $CLASSPATH net.yacy.yacy";
if [ $GUI -eq 1 ] #gui
then
- cmdline="$cmdline -gui"
+ cmdline="$cmdline -gui $parameter"
fi
if [ $DEBUG -eq 1 ] #debug
then