propagate from branch 'i2p.i2p.zzz.test' (head 1959049922a17635226170bf3309e281d8e02e43)

to branch 'i2p.i2p' (head a06bf8c92a0e1195b6f98dbad3e8898339bc6053)
This commit is contained in:
zzz
2012-01-08 13:16:07 +00:00
54 changed files with 6932 additions and 3841 deletions

View File

@ -193,7 +193,7 @@ Applications:
Flag icons:
- Jersey and EU flag icons: public domain, courtesy Xrmap flag
collection http://www.arvernes.com/wiki/index.php/Xrmap
- Guernsey flag from the Open Clip Art Library, released into the public domain
- Guernsey and Isle of Man flags from the Open Clip Art Library, released into the public domain
- All other flag icons: public domain, courtesy mjames@gmail.com http://www.famfamfam.com/
Silk icons: See licenses/LICENSE-SilkIcons.txt

View File

@ -614,7 +614,8 @@ public class Storage
} catch (Exception ex) {
ex.printStackTrace();
}
} }
}
}
_filterNameCache.put(name, rv);
return rv;
}

View File

@ -2069,9 +2069,11 @@ private static class FetchAndAdd implements Runnable {
// buf.append("<input type=\"hidden\" name=\"p\" value=\"").append(peerParam).append("\" >\n");
buf.append(_("Torrent was not retrieved from {0}", urlify(_url)));
String link = _url.replace("&", "&amp;").replace(" ", "%20").replace(":", "%3A").replace("/", "%2F");
/**** FIXME ticket #575
buf.append(" - [<a href=\"/i2psnark/?newURL=").append(link).append("#add\" >");
buf.append(_("Retry"));
buf.append("</a>]");
****/
_manager.addMessage(buf.toString());
}
} finally {

View File

@ -8,8 +8,12 @@ import net.i2p.apps.systray.UrlLauncher;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.startup.ClientAppConfig;
import net.i2p.util.Log;
import org.tanukisoftware.wrapper.WrapperManager;
import org.tanukisoftware.wrapper.event.WrapperControlEvent;
import org.tanukisoftware.wrapper.event.WrapperEvent;
import org.tanukisoftware.wrapper.event.WrapperEventListener;
/**
* Handler to deal with form submissions from the service config form and act
@ -18,6 +22,10 @@ import org.tanukisoftware.wrapper.WrapperManager;
*/
public class ConfigServiceHandler extends FormHandler {
private static WrapperEventListener _signalHandler;
private static final String PROP_GRACEFUL_HUP = "router.gracefulHUP";
/**
* Register two shutdown hooks, one to rekey and/or tell the wrapper we are stopping,
* and a final one to tell the wrapper we are stopped.
@ -127,6 +135,79 @@ public class ConfigServiceHandler extends FormHandler {
}
}
/**
* Register a handler for signals,
* so we can handle HUP from the wrapper (non-Windows only)
*
* @since 0.8.13
*/
synchronized static void registerSignalHandler(RouterContext ctx) {
if (ctx.hasWrapper() && _signalHandler == null &&
!System.getProperty("os.name").startsWith("Win")) {
_signalHandler = new SignalHandler(ctx);
long mask = WrapperEventListener.EVENT_FLAG_CONTROL;
WrapperManager.addWrapperEventListener(_signalHandler, mask);
}
}
/**
* Unregister the handler for signals
*
* @since 0.8.13
*/
public synchronized static void unregisterSignalHandler() {
if (_signalHandler != null) {
WrapperManager.removeWrapperEventListener(_signalHandler);
_signalHandler = null;
}
}
/**
* Catch signals.
* The wrapper will potentially forward HUP, USR1, and USR2.
* But USR1 and USR2 are used by the JVM GC and cannot be trapped.
* So we will only get HUP.
*
* @since 0.8.13
*/
private static class SignalHandler implements WrapperEventListener {
private final RouterContext _ctxt;
public SignalHandler(RouterContext ctx) {
_ctxt = ctx;
}
public void fired(WrapperEvent event) {
if (!(event instanceof WrapperControlEvent))
return;
WrapperControlEvent wce = (WrapperControlEvent) event;
Log log = _ctxt.logManager().getLog(ConfigServiceHandler.class);
if (log.shouldLog(Log.WARN))
log.warn("Got signal: " + wce.getControlEventName());
int sig = wce.getControlEvent();
switch (sig) {
case WrapperManager.WRAPPER_CTRL_HUP_EVENT:
if (_ctxt.getBooleanProperty(PROP_GRACEFUL_HUP)) {
wce.consume();
if (!(_ctxt.router().gracefulShutdownInProgress() ||
_ctxt.router().isFinalShutdownInProgress())) {
System.err.println("WARN: Graceful shutdown initiated by SIGHUP");
log.logAlways(Log.WARN, "Graceful shutdown initiated by SIGHUP");
registerWrapperNotifier(_ctxt, Router.EXIT_GRACEFUL, false);
_ctxt.router().shutdownGracefully();
}
} else {
log.log(Log.CRIT, "Hard shutdown initiated by SIGHUP");
// JVM will call ShutdownHook if we don't do it ourselves
//wce.consume();
//registerWrapperNotifier(_ctxt, Router.EXIT_HARD, false);
//_ctxt.router().shutdown(Router.EXIT_HARD);
}
break;
}
}
}
@Override
protected void processForm() {
if (_action == null) return;
@ -194,6 +275,7 @@ public class ConfigServiceHandler extends FormHandler {
addFormError(_("Warning: unable to install the service") + " - " + ioe.getMessage());
}
}
private void uninstallService() {
try {
Runtime.getRuntime().exec("uninstall_i2p_service_winnt.bat");

View File

@ -10,7 +10,7 @@ import org.mortbay.http.Version;
public class LogsHelper extends HelperBase {
public LogsHelper() {}
/** @since 0.8.11 */
/** @since 0.8.12 */
public String getJettyVersion() {
return jettyVersion();
}

View File

@ -367,6 +367,7 @@ public class RouterConsoleRunner {
ctx.addShutdownTask(new NewsShutdown(fetcher, newsThread));
// stat summarizer registers its own hook
ctx.addShutdownTask(new ServerShutdown());
ConfigServiceHandler.registerSignalHandler(ctx);
} // else log CRIT ?
}

View File

@ -380,7 +380,7 @@
packagenames="*"
use="true"
splitindex="true"
doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}"
doctitle="I2P Javadocs for Release ${release.number} Build ${build.number}${build.extra}"
windowtitle="I2P Anonymous Network - Java Documentation - Version ${release.number}">
<group title="Core SDK (i2p.jar)" packages="net.i2p:net.i2p.*:net.i2p.client:net.i2p.client.*:net.i2p.internal:net.i2p.internal.*:freenet.support.CPUInformation:org.bouncycastle.crypto:org.bouncycastle.crypto.*:gnu.crypto.*:gnu.gettext:org.xlattice.crypto.filters:com.nettgryppa.security:net.metanotion:net.metanotion.*" />
<group title="Streaming Library" packages="net.i2p.client.streaming" />
@ -469,7 +469,12 @@
<arg value="-f1" />
<arg value="-d;" />
</exec>
<echo message="Build number is ${build.number}" />
<exec executable="awk" outputproperty="build.extra" failonerror="false">
<arg value="-F&quot;" />
<arg value="/public final static String EXTRA/{print $2}" />
<arg value="router/java/src/net/i2p/router/RouterVersion.java" />
</exec>
<echo message="Build number is ${build.number}${build.extra}" />
</target>
<target name="clean" depends="pkgclean" >
@ -478,6 +483,9 @@
<delete file="i2pinstall.exe" failonerror="false" quiet="true" />
<delete file="i2p.exe" failonerror="false" quiet="true" />
<delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
<delete>
<fileset dir="." includes="i2pinstall*jar i2pinstall*bz2" />
</delete>
<delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
<delete file="BOB-one.jar" failonerror="false" quiet="true" />
<delete dir="core/c/jbigi/bin" />
@ -795,8 +803,8 @@
<copy todir="pkg-temp/docs/" >
<fileset dir="installer/resources/readme/" includes="readme*.html" />
<fileset dir="installer/resources/proxy/" includes="*.ht" />
<!-- lang_ar.png added in 0.8.4; a1,a2,je, and eu.png added in 0.8.9; gg.png added in 0.8.10 -->
<fileset dir="installer/resources/" includes="icons/flags/lang_ar.png icons/flags/gg.png icons/flags/je.png icons/flags/eu.png icons/flags/a1.png icons/flags/a2.png" />
<!-- lang_ar.png added in 0.8.4; a1,a2,je, and eu.png added in 0.8.9; gg.png added in 0.8.10; im.png added in 0.8.12 -->
<fileset dir="installer/resources/" includes="icons/flags/lang_ar.png icons/flags/gg.png icons/flags/je.png icons/flags/eu.png icons/flags/im.png icons/flags/a1.png icons/flags/a2.png" />
</copy>
</target>
@ -1041,14 +1049,14 @@
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-freebsd-only.jar" installerType="standard" basedir="${basedir}" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
</target>
<target name="installer-linux" depends="clean, preppkg-linux-only, getReleaseNumber, getBuildNumber, buildProperties, util-list-changes, izpack-patches" >
<mkdir dir="pkg-temp/installer" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-linux-only.jar" installerType="standard" basedir="${basedir}" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_linux-only.jar" installerType="standard" basedir="${basedir}" />
</target>
@ -1057,7 +1065,7 @@
<mkdir dir="pkg-temp/osx" />
<!-- set if unset -->
<property name="workspace.changes.util.tr" value="" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-osx-only.jar" installerType="standard" basedir="${basedir}" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" installerType="standard" basedir="${basedir}" />
<ant target="installer2app" />
<delete dir="pkg-temp/osx" />
</target>
@ -1070,21 +1078,21 @@
<mkdir dir="pkg-temp/osx" />
<exec executable="python" failonerror="true">
<arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
<arg value="${basedir}/i2pinstall_${release.number}-osx-only.jar" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-osx-install.app" />
<arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx-only.jar" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
</exec>
<exec executable="chmod" failonerror="true" osfamily="unix">
<arg value="755" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-osx-install.app/Contents/MacOS/JavaApplicationStub" />
<arg value="${basedir}/pkg-temp/osx/i2p-${release.number}-${build.number}${build.extra}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
</exec>
<exec executable="tar" osfamily="unix" failonerror="true">
<arg value="--owner=root" />
<arg value="--group=root" />
<arg value="-cjvf" />
<arg value="${basedir}/i2pinstall_${release.number}-osx.tar.bz2" />
<arg value="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_osx.tar.bz2" />
<arg value="-C" />
<arg value="${basedir}/pkg-temp/osx" />
<arg value="i2p-${release.number}-osx-install.app" />
<arg value="i2p-${release.number}-${build.number}${build.extra}_osx-install.app" />
</exec>
</target>
@ -1119,7 +1127,7 @@
<attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
</manifest>
</jar>
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-windows-only.jar" installerType="standard" basedir="${basedir}" />
<izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${release.number}-${build.number}${build.extra}_windows-only.jar" installerType="standard" basedir="${basedir}" />
<delete dir="pkg-temp/win" />
</target>

View File

@ -67,6 +67,6 @@ fi
echo "Compiling C code..."
rm -f jbigi.o $LIBFILE
$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c || exit 1
$CC $LINKFLAGS $INCLUDES $INCLUDELIBS -o $LIBFILE jbigi.o $STATICLIBS || exit 1
$CC $LINKFLAGS $INCLUDES -o $LIBFILE jbigi.o $INCLUDELIBS $STATICLIBS || exit 1
exit 0

View File

@ -16,7 +16,7 @@ package net.i2p;
public class CoreVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = "0.8.11";
public final static String VERSION = "0.8.12";
public static void main(String args[]) {
System.out.println("I2P Core version: " + VERSION);

View File

@ -220,7 +220,8 @@ public class EepGet {
if (username != null && password != null)
get.addAuthorization(username, password);
get.addStatusListener(get.new CLIStatusListener(markSize, lineLen));
get.fetch(CONNECT_TIMEOUT, -1, inactivityTimeout);
if (!get.fetch(CONNECT_TIMEOUT, -1, inactivityTimeout))
System.exit(1);
}
public static String suggestName(String url) {

View File

@ -92,6 +92,7 @@ public class EepHead extends EepGet {
System.err.println("Etag: " + get.getETag());
} else {
System.err.println("Failed " + url);
System.exit(1);
}
}

View File

@ -83,6 +83,7 @@ public class PartialEepGet extends EepGet {
System.err.println("Etag: " + get.getETag());
} else {
System.err.println("Failed " + url);
System.exit(1);
}
}

View File

@ -26,7 +26,6 @@ public class ResettableGZIPInputStream extends InflaterInputStream {
private final ExtraByteInputStream _extraByteInputStream;
/** keep a typesafe copy of this */
private final LookaheadInputStream _lookaheadStream;
private static final byte[] _oneDummyByte = new byte[1];
private final InputStream _sequenceStream = null;
private final CRC32 _crc32;
private final byte _buf1[] = new byte[1];
@ -312,6 +311,7 @@ public class ResettableGZIPInputStream extends InflaterInputStream {
*
* http://code.google.com/p/google-apps-sso-sample/issues/detail?id=8
*
* @since 0.8.12
*/
private static class ExtraByteInputStream extends FilterInputStream {
private static final byte DUMMY = 0;

View File

@ -161,7 +161,8 @@ public class SSLEepGet extends EepGet {
get._saveCerts = true;
get._commandLine = true;
get.addStatusListener(get.new CLIStatusListener(1024, 40));
get.fetch(45*1000, -1, 60*1000);
if(!get.fetch(45*1000, -1, 60*1000))
System.exit(1);
}
private static void usage() {

48
debian/changelog vendored
View File

@ -1,3 +1,51 @@
i2p (0.8.12-2) stable; urgency=low
* postinst: Don't fail if the i2psvc group doesn't exist
-- Kill Your TV <killyourtv@i2pmail.org> Fri, 06 Jan 2012 18:43:09 +0000
i2p (0.8.12-1) stable; urgency=low
* New upstream I2P release
* Debconf:
- add wrapper.java.maxmemory from wrapper.config
- The warning about the daemon user needing to exist was confusing to some
that assumed this meant that i2psvc had to exit. This warning has been
clarified.
- Spanish, Swedish, Ukrainian translation updates
* Initscript changes/fixes:
- increase shutdown wait-time in initscript
- renumber "wrapper.additional" lines (since gaps are allowed with newer
wrapper versions)
- move I2PTEMP to /tmp/i2p-daemon
- move router.ping to /var/run/i2p
- various other clean-ups
- explicity redirect errors to stderr
* maintainer scripts:
- postinst: rewrite the handling of an existing i2psvc account
- postrm: remove /etc/default/i2p if the package is purged
-- Kill Your TV <killyourtv@i2pmail.org> Fri, 06 Jan 2012 02:49:03 +0000
i2p (0.8.11-2) stable; urgency=medium
* Fix STUPID bug running I2P with i2prouter. Thanks soundwave.
-- Kill Your TV <killyourtv@i2pmail.org> Tue, 08 Nov 2011 20:02:05 +0000
i2p (0.8.11-1) stable; urgency=low
* New Upstream Version
* sv and uk debconf translation updates
-- Kill Your TV <killyourtv@i2pmail.org> Mon, 07 Nov 2011 19:20:15 +0000
i2p (0.8.10-1) stable; urgency=medium
* New upstream version
-- Kill Your TV <killyourtv@i2pmail.org> Thu, 20 Oct 2011 05:25:04 +0000
i2p (0.8.9-1) stable; urgency=medium
* New upstream version

1
debian/control vendored
View File

@ -76,6 +76,7 @@ Suggests: tor,
imule,
i2pfox,
irc-client,
itoopie,
jircii,
mail-client,
mail-reader,

5
debian/i2p.postinst vendored
View File

@ -63,14 +63,15 @@ case "$1" in
# Create user and group as a system user.
if getent passwd i2psvc > /dev/null 2>&1 ; then
groupadd -f $I2PSYSUSER || true
usermod -c "I2P Router Daemon" -d $I2PHOME -g $I2PSYSUSER -s "/bin/false" \
$I2PSYSUSER -e 1 > /dev/null 2>&1
$I2PSYSUSER -e 1 > /dev/null 2>&1 || true
else
adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER
fi
[ -d /var/log/i2p ] || mkdir -m0750 /var/log/i2p
chown -f -R $I2PSYSUSER:adm /var/log/i2p
chown -f -R $I2PSYSUSER:i2psvc /var/log/i2p
# Has someone set the permissions with dpkg-statoverride? If so, obey them.
if ! dpkg-statoverride --list $I2PHOME > /dev/null 2>&1

View File

@ -1,13 +0,0 @@
Add debian package vesion to the EXTRA version field
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -21,7 +21,7 @@
public final static long BUILD = 0;
/** for example "-test" */
- public final static String EXTRA = "";
+ public final static String EXTRA = "deb1";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);

View File

@ -1,4 +1,3 @@
0001-path-substitution.patch
0002-jbigi-soname.patch
0003-renaming-jcpuid.patch
debian-version.patch

10
debian/rules vendored
View File

@ -26,7 +26,12 @@ build:
JAVA_HOME=/usr/lib/jvm/default-java
I2P=$(CURDIR)/pkg-temp
ROUTERVERSION=$(CURDIR)/router/java/src/net/i2p/router/RouterVersion.java
# I2P's version will be displayed in the router console as "$I2PVERSION-$EXTRAPREFIX$DEBIANVERSION", eg. 0.8.12-0-deb1
export EXTRAPREFIX := deb
export JAVA_HOME I2P
export DEBIANVERSION := $(shell dpkg-parsechangelog |awk -F' ' '/Version/{print $$2}' |sed 's/.*-\([[:digit:]]\{1,\}\).*$$/\1/')
#export DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
%:
@ -35,6 +40,7 @@ export JAVA_HOME I2P
clean: createcopyright
override_dh_auto_clean:
-[ -r $(CURDIR)/debian/routerversion.java.bak ] && mv -f $(CURDIR)/debian/routerversion.java.bak $(ROUTERVERSION)
dh_auto_clean
ant distclean
# The next line is used by KYTV when building from source packages
@ -48,6 +54,9 @@ override_dh_auto_build:
binary-indep: build-indep
build-indep:
dh_prep
cp -f $(ROUTERVERSION) $(CURDIR)/debian/routerversion.java.bak
sed -e "s/\(.*EXTRA\ =\ \)[^ ]*\"\(.*\)\"/\1\"\2-$$EXTRAPREFIX$$DEBIANVERSION\"/" < $(ROUTERVERSION) > $(ROUTERVERSION).tmp
mv -f $(ROUTERVERSION).tmp $(ROUTERVERSION)
# The next line is used by KYTV when building from source packages
#[ -r jetty/jetty-5.1.15.tgz ] && ln -sf $(CURDIR)/jetty/jetty-5.1.15.tgz $(CURDIR)/apps/jetty/jetty-5.1.15.tgz
ant preppkg-unix javadoc
@ -76,7 +85,6 @@ createcopyright:
@/bin/echo -e "at http://www.i2p2.de/newdevelopers#getting-the-i2p-code\n\n\n" >> $(CURDIR)/debian/copyright
@/bin/cat $(CURDIR)/LICENSE.txt >> $(CURDIR)/debian/copyright
override_dh_compress:
dh_compress -X.xsl -X.xml

View File

@ -1,3 +1,14 @@
2012-01-06 kytv
* EepGet: If transfer fails, exit with status 1 (fixes #576)
* 2012-01-06 0.8.12 released
2012-01-04 kytv
* Update geoip.txt based on Maxmind GeoLite Country database from 2011-12-08
2012-01-02 kytv
* Wrapper 3.5.13 for everything other than armv7.
2012-01-02 zzz
* Fix webapp PortMapper lookup for SSL-only console
* Wrapper 3.5.13 for arm v7

View File

@ -4,7 +4,7 @@
<info>
<appname>i2p</appname>
<appversion>0.8.11</appversion>
<appversion>0.8.12</appversion>
<authors>
<author name="I2P" email="http://forum.i2p2.de/"/>
</authors>

View File

@ -36,7 +36,8 @@ with "ant -Dbits=32 compile-c-unix".
For macosx, combine the universal-32 and universal-64 files
from the delta pack (each a 2-architecture fat file)
into a "quad-fat" binary.
into a "quad-fat" binary. Instructions can be found in
macos/README.txt
For win64, build from source following the instructions
in win64/README-x64-win.txt.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
Changes will probably be needed for newer versions than 3.5.12.
Changes may be needed for newer versions than 3.5.13.
To use the patch in this directory, copy Makefile-windows-x86-32.nmake to
Makefile-windows-x86-64.nmake then "patch < x64-win.patch".

View File

@ -1,3 +1,10 @@
# Last updated based on Maxmind GeoLite Country
# dated 2011-12-08
# Script borrowed from Tor
#
# wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
# cut -d, -f3-5 < GeoIPCountryWhois.csv|sed 's/"//g' > geoip.txt
# cut -d, -f5,6 < GeoIPCountryWhois.csv |sed 's/"//g' | sort | uniq > countries.txt
A1,Anonymous Proxy
A2,Satellite Provider
AD,Andorra
@ -179,6 +186,7 @@ PH,Philippines
PK,Pakistan
PL,Poland
PM,Saint Pierre and Miquelon
PN,Pitcairn Islands
PR,Puerto Rico
PS,Palestinian Territory
PT,Portugal

File diff suppressed because it is too large Load Diff

View File

@ -1012,6 +1012,7 @@ start() {
startwait
}
stopit() {
# $1 exit if down flag
@ -1028,7 +1029,7 @@ stopit() {
if [ "X$IGNORE_SIGNALS" = "X" ]
then
# Running so try to stop it.
kill $pid
kill -TERM $pid
if [ $? -ne 0 ]
then
# An explanation for the failure should have been given
@ -1080,6 +1081,43 @@ stopit() {
fi
}
graceful() {
# $1 exit if down flag
eval echo `gettext 'Stopping $APP_LONG_NAME gracefully...'`
getpid
if [ "X$pid" = "X" ]
then
eval echo `gettext '$APP_LONG_NAME was not running.'`
if [ "X$1" = "X1" ]
then
exit 1
fi
else
if [ "X$IGNORE_SIGNALS" = "X" ]
then
# Running so try to stop it.
# This sends HUP. router.gracefulHUP must be set in router.config,
# or else this will do the same as stop.
kill $pid
if [ $? -ne 0 ]
then
# An explanation for the failure should have been given
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
exit 1
fi
else
rm -f "$ANCHORFILE"
if [ -f "$ANCHORFILE" ]
then
# An explanation for the failure should have been given
eval echo `gettext 'Unable to stop $APP_LONG_NAME.'`
exit 1
fi
fi
fi
}
pause() {
eval echo `gettext 'Pausing $APP_LONG_NAME.'`
}
@ -1557,6 +1595,7 @@ showUsage() {
echo "`gettext ' console Launch in the current console.'`"
echo "`gettext ' start Start in the background as a daemon process.'`"
echo "`gettext ' stop Stop if running as a daemon or in another console.'`"
echo "`gettext ' graceful Stop gracefully, may take up to 11 minutes.'`"
echo "`gettext ' restart Stop if running and then start.'`"
echo "`gettext ' condrestart Restart only if already running.'`"
if [ -n "$PAUSABLE" ] ; then
@ -1624,6 +1663,11 @@ docommand() {
stopit "0"
;;
'graceful')
checkUser "" "$COMMAND"
graceful "0"
;;
'restart')
checkUser touchlock "$COMMAND"
if [ ! -n "$FIXED_COMMAND" ] ; then

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

View File

@ -1,30 +1,15 @@
<!--
<i2p.news date="$Date: 2011-11-08 00:00:00 $">
<i2p.release version="0.8.11" date="2011/11/08" minVersion="0.6" />
<i2p.news date="$Date: 2012-01-06 00:00:00 $">
<i2p.release version="0.8.12" date="2012/01/06" minVersion="0.6" />
-->
<div lang="en">
<h3>2011-11-08: <b>0.8.11 <a href="http://www.i2p2.i2p/release-0.8.11.html">Released</a></b></h3>
<h3>2012-01-06: <b>0.8.12 <a href="http://www.i2p2.i2p/release-0.8.12.html">Released</a></b></h3>
<p>
The unprecedented network growth starting October 5th
has dramatically increased network congestion, especially on evenings (UTC)
and weekends. The last two releases contained a few changes that we hoped
would relieve the pressure, but unfortunately these measures have been only
modest successes. The primary issue is to limit the number of direct router
to-router connections in the network. This isn't a new problem; we've been
working on it for several years, usually with good results. However, the recent
growth pushed us over the edge once again.
</p><p>
Release 0.8.11 includes several more changes to reduce the number of router-to-router
connections and increase connection and tunnel build capacity. The goal, of course,
is to improve tunnel build success rates and general reliability. As always, there's
a few bug fixes and translation updates.
</p><p>
We welcome all our new users. Please be patient as we work to improve network
performance. Debugging congestion problems in a distributed anonymous network
is a continuing challenge. Please help improve the network
by restarting your router once the upgrade is downloaded.
The 0.8.12 release fixes several serious message corruption bugs.
It also contains a redesign of the router's congestion control, and continued
optimization of CPU and memory usage. We are hopeful that these changes will
improve network performance. Upgrading is recommended.
</p><p>
Say hello to the volunteers on the <a href="irc://127.0.0.1:6668/i2p-help">#i2p-help IRC channel</a>.
<a href="http://www.i2p2.i2p/getinvolved.html">Get involved</a>,

View File

@ -168,6 +168,10 @@ wrapper.logfile.maxfiles=2
# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE
# these will shut down or crash the JVM
wrapper.signal.mode.usr1=IGNORE
wrapper.signal.mode.usr2=IGNORE
# choose what to do if the JVM kills itself based on the exit code
wrapper.on_exit.default=SHUTDOWN
wrapper.on_exit.0=SHUTDOWN

View File

@ -241,6 +241,8 @@ public class Router implements RouterClock.ClockShiftListener {
String now = Long.toString(System.currentTimeMillis());
_config.put("router.firstInstalled", now);
_config.put("router.updateLastInstalled", now);
// only compatible with new i2prouter script
_config.put("router.gracefulHUP", "true");
saveConfig();
}
// ********* Start no threads before here ********* //
@ -393,7 +395,7 @@ public class Router implements RouterClock.ClockShiftListener {
_isAlive = true;
_started = _context.clock().now();
try {
Runtime.getRuntime().removeShutdownHook(_shutdownHook);
Runtime.getRuntime().addShutdownHook(_shutdownHook);
} catch (IllegalStateException ise) {}
I2PThread.addOOMEventListener(_oomListener);
@ -1004,9 +1006,12 @@ public class Router implements RouterClock.ClockShiftListener {
/**
* Cancel the JVM runtime hook before calling this.
* Called by the ShutdownHook.
* NOT to be called by others, use shutdown().
*/
public void shutdown2(int exitCode) {
_shutdownInProgress = true;
_log.log(Log.CRIT, "Starting final shutdown(" + exitCode + ')');
// So we can get all the way to the end
// No, you can't do Thread.currentThread.setDaemon(false)
if (_killVMOnEnd) {
@ -1021,6 +1026,7 @@ public class Router implements RouterClock.ClockShiftListener {
// Run the shutdown hooks first in case they want to send some goodbye messages
// Maybe we need a delay after this too?
for (Runnable task : _context.getShutdownTasks()) {
//System.err.println("Running shutdown task " + task.getClass());
if (_log.shouldLog(Log.WARN))
_log.warn("Running shutdown task " + task.getClass());
try {
@ -1115,7 +1121,7 @@ public class Router implements RouterClock.ClockShiftListener {
//Runtime.getRuntime().halt(exitCode);
// allow the Runtime shutdown hooks to execute
Runtime.getRuntime().exit(exitCode);
} else {
} else if (System.getProperty("java.vendor").contains("Android")) {
Runtime.getRuntime().gc();
}
}

View File

@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 27;
public final static long BUILD = 0;
/** for example "-test" */
public final static String EXTRA = "-rc";
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);

View File

@ -32,6 +32,10 @@ public class ShutdownHook extends Thread {
setName("Router " + _id + " shutdown");
Log l = _context.logManager().getLog(Router.class);
l.log(Log.CRIT, "Shutting down the router...");
// Needed to make the wrapper happy, otherwise it gets confused
// and thinks we haven't shut down, possibly because it
// prevents other shutdown hooks from running
_context.router().setKillVMOnEnd(false);
_context.router().shutdown2(Router.EXIT_HARD);
}
}