From eac62a68823de784a5dd03ec1d09abe9c1d9e852 Mon Sep 17 00:00:00 2001 From: lotus Date: Thu, 22 May 2008 15:48:51 +0000 Subject: [PATCH] * 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 --- build.xml | 6 ++-- htroot/ConfigBasic.html | 2 +- source/de/anomic/server/serverSystem.java | 2 +- source/de/anomic/yacy/yacyVersion.java | 36 ++++++++++++++++++++--- startYACY.bat | 2 ++ startYACY_noconsole.bat | 4 +++ 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/build.xml b/build.xml index 575b458ab..434eece1a 100644 --- a/build.xml +++ b/build.xml @@ -393,10 +393,12 @@ - + + diff --git a/htroot/ConfigBasic.html b/htroot/ConfigBasic.html index d6756bea2..c9410aa82 100644 --- a/htroot/ConfigBasic.html +++ b/htroot/ConfigBasic.html @@ -39,7 +39,7 @@
Community-based web search
- +
Search portal for your own web pages
diff --git a/source/de/anomic/server/serverSystem.java b/source/de/anomic/server/serverSystem.java index 60024b1e2..2447761f7 100644 --- a/source/de/anomic/server/serverSystem.java +++ b/source/de/anomic/server/serverSystem.java @@ -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"; diff --git a/source/de/anomic/yacy/yacyVersion.java b/source/de/anomic/yacy/yacyVersion.java index 109a48577..fbbdd09e5 100644 --- a/source/de/anomic/yacy/yacyVersion.java +++ b/source/de/anomic/yacy/yacyVersion.java @@ -370,10 +370,38 @@ public final class yacyVersion implements Comparator, Comparablenul" + 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, Comparable, Comparablenul" + 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 diff --git a/startYACY.bat b/startYACY.bat index 5cb36836b..c6bc543b4 100644 --- a/startYACY.bat +++ b/startYACY.bat @@ -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 diff --git a/startYACY_noconsole.bat b/startYACY_noconsole.bat index af63bfcc1..45b97a74d 100644 --- a/startYACY_noconsole.bat +++ b/startYACY_noconsole.bat @@ -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