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
pull/1/head
orbiter 14 years ago
parent d4e4967e19
commit b3f0d06444

@ -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);

@ -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;

@ -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

Loading…
Cancel
Save