Version 1.2 uses 'nohup' on Linux to redirect output to a file. nohup is quite inflexible, usually dumps output to a file 'nohup.out' in the current working directory (or ~/nohup.out if the current working directory is not writable), the name of the file cannot be configured. nohup is meant to prevent hangup signals from causing an application to exit. This is an unlikely event in case of this game, after all the developers can influence which returns signals are produced by their application.
If output is to be redirected (why?) then it should be redirected to a file using the ways the shell provides, namely standard output and standard error output redirection (or piping into 'tee').
$ diff -Naur mule.sh.orig mule.sh
--- mule.sh.orig 2010-01-10 06:36:11.385625737 +0100
+++ mule.sh 2010-01-10 07:15:55.585704580 +0100
@@ -1,9 +1,20 @@
#!/bin/sh
-cd data
+#
+# Find java executable and start launcher
+#
if [ -f "/usr/lib/jvm/java-6-sun/bin/java" ]; then
- nohup /usr/lib/jvm/java-6-sun/bin/java -jar ./launcher.jar nohup /usr/lib/jvm/java-6-sun/bin/java -Xms64m -Xmx256m -Djava.library.path=lib -jar ./data.jar
+ java_path=/usr/lib/jvm/java-6-sun/bin/
elif [ -n "$JAVA_HOME" ]; then
- nohup $JAVA_HOME/bin/java -jar ./launcher.jar nohup $JAVA_HOME/bin/java -Xms64m -Xmx256m -Djava.library.path=lib -jar ./data.jar
+ java_path="$JAVA_HOME/"
+elif [ -n "`which java`" ]; then
+ java_path=""
else
- nohup java -jar ./launcher.jar nohup java -Xms64m -Xmx256m -Djava.library.path=lib -jar ./data.jar
+ echo 'ERROR: Cannot find your java installation. Please ensure the JAVA_HOME environment variable is set or the 'java' binary is in your path.' >&2
+ exit 1
fi
+
+cd data
+"${java_path}java" -jar ./launcher.jar "${java_path}java" -Xms64m -Xmx256m -Djava.library.path=lib -jar ./data.jar
+# Alternatively, redirect all output to data/output.txt:
+#"${java_path}java" -jar ./launcher.jar >output.txt 2>&1 "${java_path}java" -Xms64m -Xmx256m -Djava.library.path=lib -jar ./data.jar >output.txt 2>&1
+cd ..
$