Skip to content

Commit

Permalink
*) Better Bourne-Shell (OpenSolaris) compatibility, update and restar…
Browse files Browse the repository at this point in the history
…t really work now. As the Bourne-Shell is the grandfather of most modern shells, it should also work with Linux (tested with Mandriva, works) and OSX (Please test!).

*) Fixed a typo.


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4054 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
low012 committed Aug 20, 2007
1 parent 72752bb commit 54004e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion htroot/Steering.html
Expand Up @@ -26,7 +26,7 @@ <h2>Steering Receipt:</h2>
If you can't reach YaCy's interface after 5 minutes restart failed.
::
<b>Installing release #[release]#</b><br />
<p>YaCy will be restartet after installation</p>
<p>YaCy will be restarted after installation</p>
#(/info)#
</p>
</body>
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/server/serverSystem.java
Expand Up @@ -99,7 +99,7 @@ public final class serverSystem {

isMacArchitecture = ((systemOS == systemMacOSC) || (systemOS == systemMacOSX));
isUnixFS = ((systemOS == systemMacOSX) || (systemOS == systemUnix));
canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows))));
canExecUnix = ((isUnixFS) || (!((systemOS == systemMacOSC) || (systemOS == systemWindows))));

// set up the MRJ Methods through reflection
if (isMacArchitecture) try {
Expand Down Expand Up @@ -340,7 +340,7 @@ public static void execAsynchronous(File scriptFile) throws IOException {
// runs a unix/linux script as separate thread
File starterFile = new File(scriptFile.getAbsolutePath() + ".starter.sh");
//deployScript(starterFile, "touch restart.starter.startet1");
deployScript(starterFile, scriptFile.getAbsolutePath() + " &" + serverCore.lfstring);
deployScript(starterFile, "#!/bin/sh" + serverCore.lfstring + scriptFile.getAbsolutePath() + " &" + serverCore.lfstring);
try {
Runtime.getRuntime().exec(starterFile.getAbsolutePath()).waitFor();
} catch (InterruptedException e) {
Expand Down
8 changes: 5 additions & 3 deletions source/de/anomic/yacy/yacyVersion.java
Expand Up @@ -371,13 +371,14 @@ public static void restart() {
try {
serverLog.logInfo("RESTART", "INITIATED");
String script =
"#!/bin/sh" + serverCore.lfstring +
"cd " + sb.getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
"while [ -e ../yacy.running ]; do" + serverCore.lfstring +
"while [ -f ../yacy.running ]; do" + serverCore.lfstring +
"sleep 1" + serverCore.lfstring +
"done" + serverCore.lfstring +
"cd ../../" + serverCore.lfstring +
"nohup ./startYACY.sh > /dev/null" + serverCore.lfstring;
File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/restart.sh");
File scriptFile = new File(sb.getRootPath(), "DATA/RELEASE/restart.sh");
serverSystem.deployScript(scriptFile, script);
serverLog.logInfo("RESTART", "wrote restart-script to " + scriptFile.getAbsolutePath());
serverSystem.execAsynchronous(scriptFile);
Expand All @@ -395,9 +396,10 @@ public static void deployRelease(String release) {
plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard();
serverLog.logInfo("UPDATE", "INITIATED");
String script =
"#!/bin/sh" + serverCore.lfstring +
"cd " + sb.getRootPath() + "/DATA/RELEASE/" + serverCore.lfstring +
"gunzip -c " + release + " | tar xf -" + serverCore.lfstring +
"while [ -e ../yacy.running ]; do" + serverCore.lfstring +
"while [ -f ../yacy.running ]; do" + serverCore.lfstring +
"sleep 1" + serverCore.lfstring +
"done" + serverCore.lfstring +
"cp -Rf yacy/* ../../" + serverCore.lfstring +
Expand Down

0 comments on commit 54004e9

Please sign in to comment.