runplain.sh improvements

This commit is contained in:
kytv
2015-05-11 01:12:13 +00:00
parent f25d2a3d3f
commit 287862887d
2 changed files with 35 additions and 11 deletions

View File

@ -147,7 +147,7 @@ Debian wrapper.config to try to prevent confusion.
if [ -n "$FIXED_COMMAND" ]
then
COMMAND="$FIXED_COMMAND"
@@ -1055,7 +979,6 @@
@@ -1058,7 +982,6 @@
if [ "X$pid" = "X" ]
then
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
@ -155,7 +155,7 @@ Debian wrapper.config to try to prevent confusion.
else
eval echo ' running: PID:$pid'
fi
@@ -1858,7 +1781,7 @@
@@ -1861,7 +1784,7 @@
}
showsetusermesg() {
@ -164,7 +164,7 @@ Debian wrapper.config to try to prevent confusion.
}
checkifstartingasroot() {
@@ -1866,7 +1789,7 @@
@@ -1869,7 +1792,7 @@
echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
showsetusermesg
echo
@ -173,7 +173,7 @@ Debian wrapper.config to try to prevent confusion.
exit 1
fi
}
@@ -1931,24 +1854,10 @@
@@ -1934,24 +1857,10 @@
status
;;

View File

@ -19,12 +19,36 @@ I2PTEMP="%SYSTEM_java_io_tmpdir"
PREFERv4="false"
CP=
for jars in `ls ${I2P}/lib/*.jar`; do CP=${CP}:${jars}; done
JAVA=java
# Try using the Java binary that I2P was installed with.
# If it's not found, try looking in the system PATH.
JAVA=$(which %JAVA_HOME/bin/java || which java)
if [ "`uname -s`" = "Darwin" ]; then
if [ -z $JAVA ] || [ ! -x $JAVA ]; then
echo "Error: Cannot find java." >&2
exit 1
fi
for jar in `ls ${I2P}/lib/*.jar`; do
if [ ! -z $CP ]; then
CP=${CP}:${jar};
else
CP=${jar}
fi
done
if [ $(uname -s) = "Darwin" ]; then
export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
fi
JAVAOPTS="-Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
nohup ${JAVA} -cp "${CP}" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1 &
echo $! > "${I2PTEMP}/router.pid"
(
nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1
) &
PID=$!
if [ ! -z $PID ] && kill -0 $PID > /dev/null 2>&1 ; then
echo "I2P started [$PID]" >&2
echo $PID > "${I2PTEMP}/router.pid"
else
echo "I2P failed to start." >&2
exit 1
fi