mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-21 09:04:37 -04:00
* 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
This commit is contained in:
@ -393,10 +393,12 @@
|
||||
<fileset dir=".">
|
||||
<include name="startYACY.bat"/>
|
||||
<include name="startYACY_noconsole.bat"/>
|
||||
<include name="stopYACY.bat"/>
|
||||
<include name="stopYACY.bat"/>
|
||||
<!--
|
||||
<include name="startYACY_Win9x.bat"/>
|
||||
<include name="startYACY_noconsole_Win9x.bat"/>
|
||||
<include name="stopYACY_Win9x.bat"/>
|
||||
<include name="stopYACY_Win9x.bat"/>
|
||||
-->
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${release_main}" file="yacy.exe" failonerror="false"/>
|
||||
|
@ -39,7 +39,7 @@
|
||||
<dl>
|
||||
<dt>Community-based web search</dt>
|
||||
<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>
|
||||
<dt>Search portal for your own web pages</dt>
|
||||
<dd>
|
||||
|
@ -348,7 +348,7 @@ public final class serverSystem {
|
||||
String script = null;
|
||||
if(isWindows){
|
||||
starterFileExtension = ".starter.bat";
|
||||
// TODO: use /K to debug
|
||||
// TODO: use /K to debug, /C for release
|
||||
script = "start /MIN CMD /C " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ");
|
||||
} else { // unix/linux
|
||||
starterFileExtension = ".starter.sh";
|
||||
|
@ -370,10 +370,38 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
|
||||
|
||||
public static void restart() {
|
||||
plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
|
||||
String apphome = sb.getRootPath().toString();
|
||||
|
||||
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
|
||||
final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart");
|
||||
/* final File yacyRestart = new File(sb.getRootPath(), "DATA/yacy.restart");
|
||||
if (!yacyRestart.exists()) {
|
||||
try {
|
||||
yacyRestart.createNewFile();
|
||||
@ -381,7 +409,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
|
||||
} catch (IOException e) {
|
||||
serverLog.logSevere("SHUTDOWN", "restart failed", e);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@ -434,9 +462,9 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
|
||||
":WAIT" + serverCore.LF_STRING +
|
||||
"ping -n 2 127.0.0.1 >nul" + 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 +
|
||||
|
||||
|
||||
"cd yacy" + serverCore.LF_STRING +
|
||||
"xcopy *.* " + apphome + " /E /Y >nul" + serverCore.LF_STRING +
|
||||
// /E - all subdirectories
|
||||
|
@ -1,6 +1,8 @@
|
||||
@Echo Off
|
||||
title YaCy
|
||||
|
||||
if exist DATA\yacy.noconsole del DATA\yacy.noconsole
|
||||
|
||||
If %1.==CPGEN. GoTo :CPGEN
|
||||
|
||||
Rem Generating the proper classpath unsing loops and labels
|
||||
|
@ -1,6 +1,10 @@
|
||||
@Echo Off
|
||||
title YaCy
|
||||
|
||||
REM setting startup type for proper restart
|
||||
if not exist DATA md DATA
|
||||
echo . >DATA\yacy.noconsole
|
||||
|
||||
If %1.==CPGEN. GoTo :CPGEN
|
||||
|
||||
Rem Generating the proper classpath unsing loops and labels
|
||||
|
Reference in New Issue
Block a user