* ported restart on Windows to unix-style, works on _noconsole now

* removed Win9x scripts from build for more tidiness and less decisions for newbies

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4835 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 17 years ago
parent 03438ee977
commit eac62a6882

@ -394,9 +394,11 @@
<include name="startYACY.bat"/> <include name="startYACY.bat"/>
<include name="startYACY_noconsole.bat"/> <include name="startYACY_noconsole.bat"/>
<include name="stopYACY.bat"/> <include name="stopYACY.bat"/>
<!--
<include name="startYACY_Win9x.bat"/> <include name="startYACY_Win9x.bat"/>
<include name="startYACY_noconsole_Win9x.bat"/> <include name="startYACY_noconsole_Win9x.bat"/>
<include name="stopYACY_Win9x.bat"/> <include name="stopYACY_Win9x.bat"/>
-->
</fileset> </fileset>
</copy> </copy>
<copy todir="${release_main}" file="yacy.exe" failonerror="false"/> <copy todir="${release_main}" file="yacy.exe" failonerror="false"/>

@ -39,7 +39,7 @@
<dl> <dl>
<dt>Community-based web search</dt> <dt>Community-based web search</dt>
<dd> <dd>
<input type="radio" name="usecase" value="freeworld" id="usecaseFreeworld" #(freeworldChecked)#::checked="checked"#(/freeworldChecked)# /> <label for="usecaseFreeworld">join and support the global network 'freeworld', search the web with a uncensored user-owned search network</label> <input type="radio" name="usecase" value="freeworld" id="usecaseFreeworld" #(freeworldChecked)#::checked="checked"#(/freeworldChecked)# /> <label for="usecaseFreeworld">join and support the global network 'freeworld', search the web with an uncensored user-owned search network</label>
</dd> </dd>
<dt>Search portal for your own web pages</dt> <dt>Search portal for your own web pages</dt>
<dd> <dd>

@ -348,7 +348,7 @@ public final class serverSystem {
String script = null; String script = null;
if(isWindows){ if(isWindows){
starterFileExtension = ".starter.bat"; starterFileExtension = ".starter.bat";
// TODO: use /K to debug // TODO: use /K to debug, /C for release
script = "start /MIN CMD /C " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ "); script = "start /MIN CMD /C " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ");
} else { // unix/linux } else { // unix/linux
starterFileExtension = ".starter.sh"; starterFileExtension = ".starter.sh";

@ -370,10 +370,38 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
public static void restart() { public static void restart() {
plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard(); plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
String apphome = sb.getRootPath().toString();
if (serverSystem.isWindows) { if (serverSystem.isWindows) {
File startType = new File(sb.getRootPath(), "DATA/yacy.noconsole");
String starterFile = "startYACY.bat";
if (startType.exists()) starterFile = "startYACY_noconsole.bat"; // startType noconsole
try{
serverLog.logInfo("RESTART", "INITIATED");
String script =
"@echo off" + serverCore.LF_STRING +
"title YaCy restarter" + serverCore.LF_STRING +
"echo YACY RESTARTER" + serverCore.LF_STRING +
"echo working..." + serverCore.LF_STRING +
"cd " + apphome + "/DATA/RELEASE/".replace("/", File.separator) + serverCore.LF_STRING +
":WAIT" + serverCore.LF_STRING +
"ping -n 2 127.0.0.1 >nul" + serverCore.LF_STRING +
"IF exist ..\\yacy.running goto WAIT" + serverCore.LF_STRING +
"cd " + apphome + serverCore.LF_STRING +
"start /MIN CMD /C " + starterFile + serverCore.LF_STRING;
File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/restart.bat".replace("/", File.separator));
serverSystem.deployScript(scriptFile, script);
serverLog.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
serverSystem.execAsynchronous(scriptFile);
serverLog.logInfo("RESTART", "script is running");
sb.terminate(5000);
} catch (IOException e) {
serverLog.logSevere("RESTART", "restart failed", e);
}
// create yacy.restart file which is used in Windows startscript // create yacy.restart file which is used in Windows startscript
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()) {
try { try {
yacyRestart.createNewFile(); yacyRestart.createNewFile();
@ -381,7 +409,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
} catch (IOException e) { } catch (IOException e) {
serverLog.logSevere("SHUTDOWN", "restart failed", e); serverLog.logSevere("SHUTDOWN", "restart failed", e);
} }
} }*/
} }
@ -434,7 +462,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
":WAIT" + serverCore.LF_STRING + ":WAIT" + serverCore.LF_STRING +
"ping -n 2 127.0.0.1 >nul" + serverCore.LF_STRING + "ping -n 2 127.0.0.1 >nul" + serverCore.LF_STRING +
"IF exist ..\\yacy.running goto WAIT" + serverCore.LF_STRING + "IF exist ..\\yacy.running goto WAIT" + serverCore.LF_STRING +
// Error: "Die Batchdatei kann nicht gefunden werden."
"IF not exist yacy goto NODATA" + serverCore.LF_STRING + "IF not exist yacy goto NODATA" + serverCore.LF_STRING +
"cd yacy" + serverCore.LF_STRING + "cd yacy" + serverCore.LF_STRING +

@ -1,6 +1,8 @@
@Echo Off @Echo Off
title YaCy title YaCy
if exist DATA\yacy.noconsole del DATA\yacy.noconsole
If %1.==CPGEN. GoTo :CPGEN If %1.==CPGEN. GoTo :CPGEN
Rem Generating the proper classpath unsing loops and labels Rem Generating the proper classpath unsing loops and labels

@ -1,6 +1,10 @@
@Echo Off @Echo Off
title YaCy title YaCy
REM setting startup type for proper restart
if not exist DATA md DATA
echo . >DATA\yacy.noconsole
If %1.==CPGEN. GoTo :CPGEN If %1.==CPGEN. GoTo :CPGEN
Rem Generating the proper classpath unsing loops and labels Rem Generating the proper classpath unsing loops and labels

Loading…
Cancel
Save