Author: jolantern
Date: 2007-12-16 00:13:23 +0000 (Sun, 16 Dec 2007)
New Revision: 16594

Modified:
   branches/legacy/stable/TODO
   branches/legacy/stable/start-freenet.sh
Log:
TODO:
* updated.

start-freenet.sh:
* begun streamlining
* threw out LD_ASSUME_KERNEL stuff, telling user to get a current JVM instead
* increased default memory size to 256M


Modified: branches/legacy/stable/TODO
===================================================================
--- branches/legacy/stable/TODO 2007-12-15 23:57:00 UTC (rev 16593)
+++ branches/legacy/stable/TODO 2007-12-16 00:13:23 UTC (rev 16594)
@@ -5,16 +5,23 @@
   cases of logflooding ("Consecutive same winner")
 - Shell scripts preconfig.sh, start-freenet.sh, stop-freenet.sh, and update.sh
   are outdated.
-- Find memory leaks (so we don't need a garbage collector)
 - building: unchecked operations
 - Vanessa's mod: problem: Vanessa did not license her mod.
-- building: deprecated language features
-- more platform specific build targets
-- Readme:
-  * goBrowsing?
+  Solution: it's at least GPL2 because she distributed the entire freenet
+  0.5 code with her modifications on Frost.
+  (thanks Agrajag for providing the relevant entries from the GNU FAQ:
+   http://www.gnu.org/licenses/gpl-faq.html
+   http://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic
+   http://www.gnu.org/licenses/gpl-faq.html#TheGPLSaysModifiedVersions
+   http://www.gnu.org/licenses/gpl-faq.html#GPLModuleLicense)
+- more platform specific build targets (rpm, deb, installer for Win?)
+- README:
+  * More help for M$ users
 - general code cleanup:
+  * Find memory leaks
   * remove dead code
   * check variable usage
+  * deprecated language features
   * check inheritance structure
 - "Attempt to use a released TempFileBucket"

@@ -53,6 +60,9 @@
 - Safe ECMAScript support
 - better diagnostics
 - default charset: replace ISO-8859-1 with UTF-8?
+- Browser feature vulnerabilities:
+  * Prefetching (solution: convert anchor to form submit button)
+  * Browser ignores MIME types of RSS feeds (and ATOM feeds?)

 Clients, Tools & Documentation:
 - junit generates a lot of errors

Modified: branches/legacy/stable/start-freenet.sh
===================================================================
--- branches/legacy/stable/start-freenet.sh     2007-12-15 23:57:00 UTC (rev 
16593)
+++ branches/legacy/stable/start-freenet.sh     2007-12-16 00:13:23 UTC (rev 
16594)
@@ -1,5 +1,24 @@
 #!/bin/sh

+# Some variables
+
+MEMORY=256m
+EXTJAR="freenet-ext.jar"
+MAINJAR="freenet.jar"
+SEED="seednodes.ref"
+SEEDBZ2="$SEED.bz2"
+
+# URLs
+
+DOWNLOADURL="http://downloads.freenetproject.org";
+EXTURL="$DOWNLOADURL/$EXTJAR"
+MAINURL="$DOWNLOADURL/freenet-stable-latest.jar"
+SEEDURL="$DOWNLOADURL/seednodes/$SEEDBZ2"
+
+# Scripts
+
+PRECONFIG="preconfig.sh"
+
 # Check to see whether we use echo -n or echo "\c" to suppress newlines.
 case "`echo 'hi there\c'; echo ' '`" in
   *c*) n='-n'; c='';;
@@ -9,74 +28,71 @@
 # and get java implementation too, Sun JDK or Kaffe
 JAVA_IMPL=`java -version 2>&1 | head -n 1 | cut -f1 -d' '`

-SEEDURL="http://www.freenetproject.org/snapshots/seednodes.ref.bz2";

-if test -f lib/freenet-ext.jar ; then
-  CLASSPATH=lib/freenet-ext.jar:$CLASSPATH
-  echo Detected freenet-ext.jar in lib/
-elif test -f freenet-ext.jar ; then
-  CLASSPATH=freenet-ext.jar:$CLASSPATH
-  echo Detected freenet-ext.jar
+if test -f lib/"$EXTJAR" ; then
+  CLASSPATH=lib/"$EXTJAR":$CLASSPATH
+  echo Detected $EXTJAR in lib/
+elif test -f "$EXTJAR" ; then
+  CLASSPATH="$EXTJAR":$CLASSPATH
+  echo Detected $EXTJAR
 else
-  echo freenet-ext.jar not found.  It can be downloaded from
-  echo http://freenetproject.org/snapshots/freenet-ext.jar
+  echo $EXTJAR not found.  It can be downloaded from
+  echo $EXTURL
   echo
   echo $n "Would you like me to download it now? [Y/n] $c"
   read resp
   case "$resp" in
     [Nn]*) exit 0;;
   esac
-  wget http://freenetproject.org/snapshots/freenet-ext.jar
-  if test ! -f freenet-ext.jar; then
+  wget "$EXTURL"
+  if test ! -f "$EXTJAR" ; then
     echo "Sorry, I couldn't download it.  Aborting."
     exit 1
   fi
 fi

-if test -f freenet.jar ; then
-  CLASSPATH=freenet.jar:$CLASSPATH
-  echo Detected freenet.jar
-elif test -f lib/freenet.jar ; then
-  CLASSPATH=lib/freenet.jar:$CLASSPATH
-  echo Detected freenet.jar in lib/
+if test -f "$MAINJAR" ; then
+  CLASSPATH="$MAINJAR":$CLASSPATH
+  echo Detected $MAINJAR
+elif test -f lib/"$MAINJAR" ; then
+  CLASSPATH=lib/"$MAINJAR":$CLASSPATH
+  echo Detected $MAINJAR in lib/
 elif test -f build/freenet/node/Node.class ; then
   CLASSPATH=build/:$CLASSPATH
   echo Detected built tree in build/
 else
-  echo freenet.jar not found. It can be downloaded from
-  echo http://freenetproject.org/snapshots/freenet-latest.jar
+  echo $MAINJAR not found. It can be downloaded from
+  echo $MAINURL
   echo
-  echo $n "Would you like me to download it now? [Y/n/u] (type u to have me 
download the unstable jar, otherwise I will fetch the stable jar) $c"
+  echo $n "Would you like me to download it now? [Y/n] $c"
   read resp
   case "$resp" in 
     [Nn]*) exit 0;;
-    [Uu]*) wget 
http://freenetproject.org/snapshots/freenet-unstable-latest.jar -O freenet.jar
-    SEEDURL="http://www.freenetproject.org/snapshots/unstable.ref.bz2"; ;;
-    [Yy]*) wget http://freenetproject.org/snapshots/freenet-latest.jar -O 
freenet.jar;;
+    [Yy]*) wget "$MAINURL" -O "$MAINJAR";;
    esac
-   if test ! -f freenet.jar; then
+   if test ! -f "$MAINJAR" ; then
      echo "Sorry, I couldn't download it. Aborting."
      exit 1
    fi
 fi

-CLASSPATH=freenet.jar:freenet-ext.jar:$CLASSPATH 
+CLASSPATH="$MAINJAR":"$EXTJAR":$CLASSPATH 
 export CLASSPATH
 # why are we permanently altering the environment?
 # because bourne shell needs it!


-if test ! -f seednodes.ref; then
-  echo seednodes.ref not found, would you like to download some seeds
+if test ! -f "$SEED" ; then
+  echo $SEED not found, would you like to download some seeds
   echo from $SEEDURL ?
   echo $n "[y/N] $c"
   read resp
   case "$resp" in
     [yY]*)
-      wget $SEEDURL -O new-seednodes.ref.bz2
-      if test -s new-seednodes.ref.bz2; then
-           bzcat new-seednodes.ref.bz2 >seednodes.ref;
-           rm -f new-seednodes.ref.bz2
+      wget $SEEDURL -O new-"$SEEDBZ2"
+      if test -s new-"$SEEDBZ2" ; then
+           bzcat new-"$SEEDBZ2" > "$SEED";
+           rm -f new-"$SEEDBZ2"
          fi
          ;;
   esac
@@ -93,73 +109,56 @@
   echo without typing anything will go with the default which is likely
   echo to be the right thing.
   echo
-  if test ! -f preconfig.sh; then
-    if test -f scripts/preconfig.sh; then
-      sh scripts/preconfig.sh
+  if test ! -f "$PRECONFIG" ; then
+    if test -f scripts/"PRECONFIG" ; then
+      sh scripts/"$PRECONFIG"
     else
-      echo Could not find preconfig.sh or scripts/preconfig.sh
+      echo Could not find $PRECONFIG or scripts/$PRECONFIG
       exit 23
     fi
   else
-  sh preconfig.sh
+  sh $PRECONFIG
   fi
   java freenet.node.Main --config
 fi

-# if Sun JDK set -server option as suggested on mailing list
-#if java -help 2>&1 | grep "[-]server" >/dev/null ;
-#then
-#  JAVA_ARGS="-server"
-#else
-#  JAVA_ARGS=""
-#fi
-# multiple reports that -server option seems to cause crashes
+# Try with -server once again

+if java -help 2>&1 | grep "[-]server" >/dev/null ; then
+       JAVA_ARGS="-server"
+else
+       JAVA_ARGS=""
+fi
+
 # sun specific options
 if [ "$JAVA_IMPL" = "java" ] ; then 
- echo Sun java detected.
- # Tell it not to use NPTL.
- # BAD THINGS happen if it uses NPTL.
- # Specifically, at least on 1.4.1. and 1.5.0b2, we get hangs
- # where many threads are stuck waiting for a lock to be 
- # unlocked but no thread owns it.
-if test -f /etc/redhat-release
-then
-  LD_ASSUME_KERNEL=2.2.5
-  export LD_ASSUME_KERNEL
-#gentoo however dies with 2.2.5
-elif test -f /etc/gentoo-release -o -f /etc/SuSE-release 
-then 
-       LD_ASSUME_KERNEL=2.4.1 
-       export LD_ASSUME_KERNEL
-else
-  LD_ASSUME_KERNEL=2.2.5
-  export LD_ASSUME_KERNEL
+       echo Sun java detected.
+       # check for bad versions
+       SUN_VERSION=`java -version 2>&1 | head -n 1 | sed "s/java version 
\"\(.*\)\"/\1/"`
+       if echo $SUN_VERSION | grep "^1.[0-3]" ; then
+               echo Old version of java detected.
+               echo Please install a 1.4.x or higher JVM.
+               exit
+       fi
+       if echo $SUN_VERSION | grep "^1.4.[01]" ; then
+               echo Sun java 1.4.0 or 1.4.1 detected.
+               echo Not a good idea. Sun java 1.4.0 has some serious problems 
relating to
+               echo NIO, which cause freenet not to run well on it. Sun java 
1.4.1 has
+               echo problems with NPTL. Please upgrade to a more recent JVM.
+               exit
+       fi
+       if echo $SUN_VERSION | grep "^1.5.0b2" ; then
+               echo Sun java 1.5.0b2 detected. Not a good idea. This version 
has problems
+               echo with NPTL.
+               exit
+       else
+               echo Sun Java 1.4.2 or higher detected. Good.
+       fi
 fi
- # 1.4.0?
- SUN_VERSION=`java -version 2>&1 | head -n 1 | sed "s/java version 
\"\(.*\)\"/\1/"`
- if echo $SUN_VERSION | grep "^1.[0-3]" ; then
-  echo Old version of java detected.
-  echo Please install a 1.4.x JVM.
-  exit
- fi
- if echo $SUN_VERSION | grep "^1.4.0" ; then
-  echo Sun java 1.4.0 detected.
-  echo Not a good idea. Sun java 1.4.0 has some serious problems relating to 
NIO, which cause freenet not to run well on it. Please upgrade to a more recent 
JVM.
-  exit
- fi
- if echo $SUN_VERSION | grep "^1.4.1" ; then
-  echo Sun java 1.4.1 detected, do not need to specify direct memory limit. OK.
- else
-  echo Sun Java 1.4.2 detected.
-  if test ! `uname` == "Darwin"; then
-       JAVA_ARGS="-XX:MaxDirectMemorySize=128m $JAVA_ARGS"
-  fi
- fi
-fi 

-echo -n "Starting Freenet now: "
-echo Command line: java -Xmx128m $JAVA_ARGS freenet.node.Main "$@"
-nice -n 10 -- java -Xmx128m $JAVA_ARGS freenet.node.Main "$@" &
+echo "Starting Freenet now: "
+JAVA_ARGS="-Xmx$MEMORY $JAVA_ARGS freenet.node.Main"
+echo Command line: java $JAVA_ARGS "$@"
+nice -n 10 -- java $JAVA_ARGS "$@" &
 echo $! > freenet.pid
 echo "Done"


Reply via email to