diff --git a/build.xml b/build.xml index 86dadfd061..afa372b0a8 100644 --- a/build.xml +++ b/build.xml @@ -179,7 +179,7 @@ - + diff --git a/installer/doc/LICENSE.wrapper.txt b/installer/doc/LICENSE.wrapper.txt new file mode 100644 index 0000000000..039b8927d3 --- /dev/null +++ b/installer/doc/LICENSE.wrapper.txt @@ -0,0 +1,41 @@ +Copyright (c) 1999, 2004 Tanuki Software + +Permission is hereby granted, free of charge, to any person +obtaining a copy of the Java Service Wrapper and associated +documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sub-license, +and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Portions of the Software have been derived from source code +developed by Silver Egg Technology under the following license: + +Copyright (c) 2001 Silver Egg Technology + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sub-license, and/or +sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + diff --git a/installer/lib/standalone-compiler.jar b/installer/lib/izpack/standalone-compiler.jar similarity index 100% rename from installer/lib/standalone-compiler.jar rename to installer/lib/izpack/standalone-compiler.jar diff --git a/installer/lib/wrapper/aix/wrapper b/installer/lib/wrapper/aix/wrapper new file mode 100644 index 0000000000..fdcc9cdc92 Binary files /dev/null and b/installer/lib/wrapper/aix/wrapper differ diff --git a/installer/lib/wrapper/aix/wrapper.jar b/installer/lib/wrapper/aix/wrapper.jar new file mode 100644 index 0000000000..75b6f87811 Binary files /dev/null and b/installer/lib/wrapper/aix/wrapper.jar differ diff --git a/installer/lib/wrapper/freebsd/wrapper b/installer/lib/wrapper/freebsd/wrapper new file mode 100644 index 0000000000..b6c3f0702f Binary files /dev/null and b/installer/lib/wrapper/freebsd/wrapper differ diff --git a/installer/lib/wrapper/freebsd/wrapper.jar b/installer/lib/wrapper/freebsd/wrapper.jar new file mode 100644 index 0000000000..83c4c3f7d9 Binary files /dev/null and b/installer/lib/wrapper/freebsd/wrapper.jar differ diff --git a/installer/lib/wrapper/hpux/wrapper b/installer/lib/wrapper/hpux/wrapper new file mode 100644 index 0000000000..9b21d6bd87 Binary files /dev/null and b/installer/lib/wrapper/hpux/wrapper differ diff --git a/installer/lib/wrapper/hpux/wrapper.jar b/installer/lib/wrapper/hpux/wrapper.jar new file mode 100644 index 0000000000..5b477e6fda Binary files /dev/null and b/installer/lib/wrapper/hpux/wrapper.jar differ diff --git a/installer/lib/wrapper/hpux64/libwrapper.sl b/installer/lib/wrapper/hpux64/libwrapper.sl new file mode 100644 index 0000000000..f9e0aeb294 Binary files /dev/null and b/installer/lib/wrapper/hpux64/libwrapper.sl differ diff --git a/installer/lib/wrapper/hpux64/wrapper b/installer/lib/wrapper/hpux64/wrapper new file mode 100644 index 0000000000..38d102daa8 Binary files /dev/null and b/installer/lib/wrapper/hpux64/wrapper differ diff --git a/installer/lib/wrapper/hpux64/wrapper.jar b/installer/lib/wrapper/hpux64/wrapper.jar new file mode 100644 index 0000000000..6da8b1983d Binary files /dev/null and b/installer/lib/wrapper/hpux64/wrapper.jar differ diff --git a/installer/lib/wrapper/i2prouter b/installer/lib/wrapper/i2prouter new file mode 100644 index 0000000000..95a27c17a9 --- /dev/null +++ b/installer/lib/wrapper/i2prouter @@ -0,0 +1,338 @@ +#! /bin/sh + +# +# Skeleton sh script suitable for starting and stopping +# wrapped Java apps on the Solaris platform. +# +# Make sure that PIDFILE points to the correct location, +# if you have changed the default location set in the +# wrapper configuration file. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application + +# Application +APP_NAME="i2p" +APP_LONG_NAME="I2P Service" + +# Wrapper +WRAPPER_CMD="wrapper" +WRAPPER_CONF="wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# If specified, the Wrapper will be run as the specified user when the 'start' +# command is passed to this script. When running with the 'console' command +# the current user will be used. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Change spaces to ":" so the tokens can be parsed. +SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` +# Get the real path to this script, resolving any symbolic links +TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'` +REALPATH= +for C in $TOKENS; do + REALPATH="$REALPATH/$C" + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + REALPATH="$LINK" + else + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done +done +# Change ":" chars back to spaces. +REALPATH=`echo $REALPATH | sed -e 's;:; ;g'` + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +PIDFILE="$PIDDIR/$APP_NAME.pid" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x $PSEXE ] +then + PSEXE="/bin/ps" + if [ ! -x $PSEXE ] + then + echo "Unable to locate 'ps'." + echo "Please report this with the location on your system." + exit 1 + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Check the configured user +if [ "X$RUN_AS_USER" != "X" ] +then + if [ "`id -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi +fi + +getpid() { + if [ -f $PIDFILE ] + then + if [ -r $PIDFILE ] + then + pid=`cat $PIDFILE` + if [ "X$pid" != "X" ] + then + # Verify that a process with this pid is still running. + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # This is a stale pid file. + rm -f $PIDFILE + echo "Removed stale pid file: $PIDFILE" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f $PIDFILE + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + if [ "X$IGNORE_SIGNALS" = "X" ] + then + exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE + else + exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE + fi + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + if [ "X$IGNORE_SIGNALS" = "X" ] + then + if [ "X$RUN_AS_USER" = "X" ] + then + exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE wrapper.daemonize=TRUE + else + su -m $RUN_AS_USER -c "exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE wrapper.daemonize=TRUE" + fi + else + if [ "X$RUN_AS_USER" = "X" ] + then + exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE wrapper.ignore_signals=TRUE wrapper.daemonize=TRUE + else + su -m $RUN_AS_USER -c "exec $CMDNICE $WRAPPER_CMD $WRAPPER_CONF wrapper.pidfile=$PIDFILE wrapper.anchorfile=$ANCHORFILE wrapper.ignore_signals=TRUE wrapper.daemonize=TRUE" + fi + fi + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "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 + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Loop for up to 5 minutes + if [ "$TOTCNT" -lt "300" ] + then + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + else + pid= + fi + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Timed out waiting for $APP_LONG_NAME to exit." + echo " Attempting a forced exit..." + kill -9 $pid + fi + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + echo "$APP_LONG_NAME is running ($pid)." + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +case "$1" in + + 'console') + console + ;; + + 'start') + start + ;; + + 'stop') + stopit + ;; + + 'restart') + stopit + start + ;; + + 'status') + status + ;; + + 'dump') + dump + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/installer/lib/wrapper/i2prouter.bat b/installer/lib/wrapper/i2prouter.bat new file mode 100644 index 0000000000..942eae3208 --- /dev/null +++ b/installer/lib/wrapper/i2prouter.bat @@ -0,0 +1,40 @@ +@echo off +setlocal + +rem +rem Java Service Wrapper general startup script +rem + +rem +rem Resolve the real path of the Wrapper.exe +rem For non NT systems, the _REALPATH and _WRAPPER_CONF values +rem can be hard-coded below and the following test removed. +rem +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem +rem Find the application home. +rem +rem %~dp0 is location of current script under NT +set _REALPATH=%~dp0 +set _WRAPPER_EXE=%_REALPATH%Wrapper.exe + +rem +rem Find the wrapper.conf +rem +:conf +set _WRAPPER_CONF="%~f1" +if not %_WRAPPER_CONF%=="" goto startup +set _WRAPPER_CONF="%_REALPATH%wrapper.conf" + +rem +rem Start the Wrapper +rem +:startup +"%_WRAPPER_EXE%" -c %_WRAPPER_CONF% +if not errorlevel 1 goto :eof +pause + diff --git a/installer/lib/wrapper/install_i2p_service_winnt.bat b/installer/lib/wrapper/install_i2p_service_winnt.bat new file mode 100644 index 0000000000..e1dc453346 --- /dev/null +++ b/installer/lib/wrapper/install_i2p_service_winnt.bat @@ -0,0 +1,35 @@ +@echo off +setlocal + +rem +rem Java Service Wrapper general NT service install script +rem + +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem +rem Find the application home. +rem +rem %~dp0 is location of current script under NT +set _REALPATH=%~dp0 +set _WRAPPER_EXE=%_REALPATH%Wrapper.exe + +rem +rem Find the wrapper.conf +rem +:conf +set _WRAPPER_CONF="%~f1" +if not %_WRAPPER_CONF%=="" goto startup +set _WRAPPER_CONF="%_REALPATH%wrapper.conf" + +rem +rem Install the Wrapper as an NT service. +rem +:startup +"%_WRAPPER_EXE%" -i %_WRAPPER_CONF% +if not errorlevel 1 goto :eof +pause + diff --git a/installer/lib/wrapper/irix/wrapper b/installer/lib/wrapper/irix/wrapper new file mode 100644 index 0000000000..9ad1a54069 Binary files /dev/null and b/installer/lib/wrapper/irix/wrapper differ diff --git a/installer/lib/wrapper/irix/wrapper.jar b/installer/lib/wrapper/irix/wrapper.jar new file mode 100644 index 0000000000..3943b8714a Binary files /dev/null and b/installer/lib/wrapper/irix/wrapper.jar differ diff --git a/installer/lib/wrapper/linux/wrapper b/installer/lib/wrapper/linux/wrapper new file mode 100644 index 0000000000..2a389f8e05 Binary files /dev/null and b/installer/lib/wrapper/linux/wrapper differ diff --git a/installer/lib/wrapper/linux/wrapper.jar b/installer/lib/wrapper/linux/wrapper.jar new file mode 100644 index 0000000000..0a40b651f5 Binary files /dev/null and b/installer/lib/wrapper/linux/wrapper.jar differ diff --git a/installer/lib/wrapper/macosx/libwrapper.jnilib b/installer/lib/wrapper/macosx/libwrapper.jnilib new file mode 100644 index 0000000000..09da61d86d Binary files /dev/null and b/installer/lib/wrapper/macosx/libwrapper.jnilib differ diff --git a/installer/lib/wrapper/macosx/wrapper b/installer/lib/wrapper/macosx/wrapper new file mode 100644 index 0000000000..51be9c749f Binary files /dev/null and b/installer/lib/wrapper/macosx/wrapper differ diff --git a/installer/lib/wrapper/macosx/wrapper.jar b/installer/lib/wrapper/macosx/wrapper.jar new file mode 100644 index 0000000000..3d2b1559a4 Binary files /dev/null and b/installer/lib/wrapper/macosx/wrapper.jar differ diff --git a/installer/lib/wrapper/osf1/wrapper b/installer/lib/wrapper/osf1/wrapper new file mode 100644 index 0000000000..5f86e91694 Binary files /dev/null and b/installer/lib/wrapper/osf1/wrapper differ diff --git a/installer/lib/wrapper/osf1/wrapper.jar b/installer/lib/wrapper/osf1/wrapper.jar new file mode 100644 index 0000000000..708f53d136 Binary files /dev/null and b/installer/lib/wrapper/osf1/wrapper.jar differ diff --git a/installer/lib/wrapper/solaris/wrapper b/installer/lib/wrapper/solaris/wrapper new file mode 100644 index 0000000000..d6edd393d6 Binary files /dev/null and b/installer/lib/wrapper/solaris/wrapper differ diff --git a/installer/lib/wrapper/solaris/wrapper.jar b/installer/lib/wrapper/solaris/wrapper.jar new file mode 100644 index 0000000000..4032473806 Binary files /dev/null and b/installer/lib/wrapper/solaris/wrapper.jar differ diff --git a/installer/lib/wrapper/uninstall_i2p_service_winnt.bat b/installer/lib/wrapper/uninstall_i2p_service_winnt.bat new file mode 100644 index 0000000000..ef837cb4ad --- /dev/null +++ b/installer/lib/wrapper/uninstall_i2p_service_winnt.bat @@ -0,0 +1,35 @@ +@echo off +setlocal + +rem +rem Java Service Wrapper general NT service uninstall script +rem + +if "%OS%"=="Windows_NT" goto nt +echo This script only works with NT-based versions of Windows. +goto :eof + +:nt +rem +rem Find the application home. +rem +rem %~dp0 is location of current script under NT +set _REALPATH=%~dp0 +set _WRAPPER_EXE=%_REALPATH%Wrapper.exe + +rem +rem Find the wrapper.conf +rem +:conf +set _WRAPPER_CONF="%~f1" +if not %_WRAPPER_CONF%=="" goto startup +set _WRAPPER_CONF="%_REALPATH%wrapper.conf" + +rem +rem Uninstall the Wrapper as an NT service. +rem +:startup +"%_WRAPPER_EXE%" -r %_WRAPPER_CONF% +if not errorlevel 1 goto :eof +pause + diff --git a/installer/lib/wrapper/win32/wrapper.jar b/installer/lib/wrapper/win32/wrapper.jar new file mode 100644 index 0000000000..46d7907b09 Binary files /dev/null and b/installer/lib/wrapper/win32/wrapper.jar differ diff --git a/installer/lib/wrapper/wrapper.conf b/installer/lib/wrapper/wrapper.conf new file mode 100644 index 0000000000..f28e76b5f0 --- /dev/null +++ b/installer/lib/wrapper/wrapper.conf @@ -0,0 +1,108 @@ +#******************************************************************** +# Wrapper Properties +#******************************************************************** +# Java Application +wrapper.java.command=java + +# Java Main class. This class must implement the WrapperListener interface +# or guarantee that the WrapperManager class is initialized. Helper +# classes are provided to do this for you. See the Integration section +# of the documentation for details. +wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp + +# Java Classpath (include wrapper.jar) Add class path elements as +# needed starting from 1 +wrapper.java.classpath.1=lib/ant.jar +wrapper.java.classpath.2=lib/heartbeat.jar +wrapper.java.classpath.3=lib/i2p.jar +wrapper.java.classpath.4=lib/i2ptunnel.jar +wrapper.java.classpath.5=lib/jasper-compiler.jar +wrapper.java.classpath.6=lib/jasper-runtime.jar +wrapper.java.classpath.7=lib/javax.servlet.jar +wrapper.java.classpath.8=lib/jnet.jar +wrapper.java.classpath.9=lib/mstreaming.jar +wrapper.java.classpath.10=lib/netmonitor.jar +wrapper.java.classpath.11=lib/org.mortbay.jetty.jar +wrapper.java.classpath.12=lib/router.jar +wrapper.java.classpath.13=lib/routerconsole.jar +wrapper.java.classpath.14=lib/sam.jar +wrapper.java.classpath.15=lib/timestamper.jar +wrapper.java.classpath.16=lib/wrapper.jar +wrapper.java.classpath.17=lib/xercesImpl.jar +wrapper.java.classpath.18=lib/xml-apis.jar + +# Java Library Path (location of Wrapper.DLL or libwrapper.so) +wrapper.java.library.path.1=. +wrapper.java.library.path.2=lib + +# Java Additional Parameters +#wrapper.java.additional.1= + +# Initial Java Heap Size (in MB) +#wrapper.java.initmemory=4 + +# Maximum Java Heap Size (in MB) +#wrapper.java.maxmemory=32 + +# Application parameters. Add parameters as needed starting from 1 +wrapper.app.parameter.1=net.i2p.router.Router +wrapper.app.parameter.2=--quiet +wrapper.app.parameter.3=> /dev/null & + +#******************************************************************** +# Wrapper Logging Properties +#******************************************************************** +# Format of output for the console. (See docs for formats) +wrapper.console.format=PM + +# Log Level for console output. (See docs for log levels) +wrapper.console.loglevel=INFO + +# Log file to use for wrapper output logging. +wrapper.logfile=../logs/wrapper.log + +# Format of output for the log file. (See docs for formats) +wrapper.logfile.format=LPTM + +# Log Level for log file output. (See docs for log levels) +wrapper.logfile.loglevel=INFO + +# Maximum size that the log file will be allowed to grow to before +# the log is rolled. Size is specified in bytes. The default value +# of 0, disables log rolling. May abbreviate with the 'k' (kb) or +# 'm' (mb) suffix. For example: 10m = 10 megabytes. +wrapper.logfile.maxsize=0 + +# Maximum number of rolled log files which will be allowed before old +# files are deleted. The default value of 0 implies no limit. +wrapper.logfile.maxfiles=0 + +# Log Level for sys/event log output. (See docs for log levels) +wrapper.syslog.loglevel=NONE + +#******************************************************************** +# Wrapper NT Service Properties +#******************************************************************** +# WARNING - Do not modify any of these properties when an application +# using this configuration file has been installed as a service. +# Please uninstall the service before modifying this section. The +# service can then be reinstalled. + +# Name of the service +wrapper.ntservice.name=i2p + +# Display name of the service +wrapper.ntservice.displayname=I2P Service + +# Description of the service +wrapper.ntservice.description=The I2P router service + +# Service dependencies. Add dependencies as needed starting from 1 +wrapper.ntservice.dependency.1= + +# Mode in which the service is installed. AUTO_START or DEMAND_START +wrapper.ntservice.starttype=AUTO_START + +# Allow the service to interact with the desktop. +wrapper.ntservice.interactive=true +