i2prouter: - note FBSD10 workaround in ticket #1118

- remove tanuki's script version checks
This commit is contained in:
kytv
2014-02-11 01:54:45 +00:00
parent 6af82f2a9a
commit d8fef53aef
2 changed files with 91 additions and 66 deletions

View File

@ -71,20 +71,13 @@ Debian wrapper.config to try to prevent confusion.
# Priority at which to run the wrapper. See "man nice" for valid priorities. # Priority at which to run the wrapper. See "man nice" for valid priorities.
# nice is only used if a priority is specified. # nice is only used if a priority is specified.
@@ -167,69 +158,13 @@ @@ -172,84 +163,8 @@
# Do not modify anything beyond this point
#-----------------------------------------------------------------------------
+JAVABINARY=$(awk -F'=' '/^ *wrapper\.java\.command/{print $2}' "$WRAPPER_CONF")
+
if [ ! -e "$WRAPPER_CONF" ]; then
echo "Starting I2P Failed: Unable to find $WRAPPER_CONF"
exit 1 exit 1
fi fi
-# Workaround for Gentoo -# Workaround for Gentoo
-JAVABINARY=$(awk -F'=' '/^ *wrapper\.java\.command/{print $2}' "$WRAPPER_CONF") JAVABINARY=$(awk -F'=' '/^ *wrapper\.java\.command/{print $2}' "$WRAPPER_CONF")
-
-if [ -e /etc/gentoo-release ]; then -if [ -e /etc/gentoo-release ]; then
- if [ $JAVABINARY = java ]; then - if [ $JAVABINARY = java ]; then
- if [ -x /etc/java-config-2/current-system-vm/bin/java ]; then - if [ -x /etc/java-config-2/current-system-vm/bin/java ]; then
@ -109,25 +102,46 @@ Debian wrapper.config to try to prevent confusion.
- echo - echo
-} -}
- -
-freebsd10() {
- echo
- echo "The current version of the Tanuki wrapper does not"
- echo "support FreeBSD 10."
- echo
- echo "See https://trac.i2p2.de/ticket/1118 for more information"
- echo "and a workaround for this issue."
- echo
- echo "In the meantime, you may start I2P by running the script"
- echo "${I2P}/runplain.sh"
- echo
-}
-
-failed() { -failed() {
- echo "**`gettext 'Failed to load the wrapper'`**" - echo "**`gettext 'Failed to load the wrapper'`**"
- case `uname -s` in - case `uname -s` in
- FreeBSD) - FreeBSD)
- # We should never get here on recent versions of FreeBSD - case `uname -r` in
- if ! $(pkg_info -E 'libiconv*' > /dev/null 2>&1); then - 10*|11*)
- echo - freebsd10
- echo "The wrapper requires libiconv." - ;;
- echo - *)
- echo "It can be installed with pkg_add -r libiconv" - # We should never get here on recent versions of FreeBSD
- echo - if ! $(pkg_info -E 'libiconv*' > /dev/null 2>&1); then
- fi - echo
- ;; - echo "The wrapper requires libiconv."
- *) - echo
- echo - echo "It can be installed with pkg_add -r libiconv"
- unsupported - echo
- ;; - fi
- esac - ;;
- exit 1 - esac
- ;;
-
- *)
- echo
- unsupported
- ;;
- esac
- exit 1
-} -}
- -
-if $(which ldd > /dev/null 2>&1); then -if $(which ldd > /dev/null 2>&1); then
@ -139,20 +153,10 @@ Debian wrapper.config to try to prevent confusion.
- failed - failed
- fi - fi
-fi -fi
-
if [ -n "$FIXED_COMMAND" ] if [ -n "$FIXED_COMMAND" ]
then then
COMMAND="$FIXED_COMMAND" @@ -1022,7 +937,6 @@
@@ -944,7 +879,7 @@
# The string passed to eval must handles spaces in paths correctly.
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP wrapper.script.version=3.5.22 $ADDITIONAL_PARA"
- eval $COMMAND_LINE || failed
+ eval $COMMAND_LINE
else
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1
@@ -1001,7 +936,6 @@
if [ "X$pid" = "X" ] if [ "X$pid" = "X" ]
then then
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`" eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
@ -160,7 +164,7 @@ Debian wrapper.config to try to prevent confusion.
else else
eval echo ' running: PID:$pid' eval echo ' running: PID:$pid'
fi fi
@@ -1804,7 +1738,7 @@ @@ -1825,7 +1739,7 @@
} }
showsetusermesg() { showsetusermesg() {
@ -169,7 +173,7 @@ Debian wrapper.config to try to prevent confusion.
} }
checkifstartingasroot() { checkifstartingasroot() {
@@ -1812,7 +1746,7 @@ @@ -1833,7 +1747,7 @@
echo "`gettext 'Running I2P as the root user is *not* recommended.'`" echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
showsetusermesg showsetusermesg
echo echo
@ -178,7 +182,7 @@ Debian wrapper.config to try to prevent confusion.
exit 1 exit 1
fi fi
} }
@@ -1877,24 +1811,10 @@ @@ -1898,24 +1812,10 @@
status status
;; ;;

View File

@ -199,25 +199,46 @@ unsupported() {
echo echo
} }
freebsd10() {
echo
echo "The current version of the Tanuki wrapper does not"
echo "support FreeBSD 10."
echo
echo "See https://trac.i2p2.de/ticket/1118 for more information"
echo "and a workaround for this issue."
echo
echo "In the meantime, you may start I2P by running the script"
echo "${I2P}/runplain.sh"
echo
}
failed() { failed() {
echo "**`gettext 'Failed to load the wrapper'`**" echo "**`gettext 'Failed to load the wrapper'`**"
case `uname -s` in case `uname -s` in
FreeBSD) FreeBSD)
# We should never get here on recent versions of FreeBSD case `uname -r` in
if ! $(pkg_info -E 'libiconv*' > /dev/null 2>&1); then 10*|11*)
echo freebsd10
echo "The wrapper requires libiconv." ;;
echo *)
echo "It can be installed with pkg_add -r libiconv" # We should never get here on recent versions of FreeBSD
echo if ! $(pkg_info -E 'libiconv*' > /dev/null 2>&1); then
fi echo
;; echo "The wrapper requires libiconv."
*) echo
echo echo "It can be installed with pkg_add -r libiconv"
unsupported echo
;; fi
esac ;;
exit 1 esac
;;
*)
echo
unsupported
;;
esac
exit 1
} }
if $(which ldd > /dev/null 2>&1); then if $(which ldd > /dev/null 2>&1); then
@ -919,8 +940,8 @@ launchdinternal() {
create_config_dir create_config_dir
# The string passed to eval must handles spaces in paths correctly. # The string passed to eval must handles spaces in paths correctly.
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP wrapper.script.version=3.5.22 $ADDITIONAL_PARA" COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
eval $COMMAND_LINE eval $COMMAND_LINE || failed
else else
eval echo `gettext '$APP_LONG_NAME is already running.'` eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1 exit 1
@ -943,7 +964,7 @@ console() {
create_config_dir create_config_dir
# The string passed to eval must handles spaces in paths correctly. # The string passed to eval must handles spaces in paths correctly.
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP wrapper.script.version=3.5.22 $ADDITIONAL_PARA" COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
eval $COMMAND_LINE || failed eval $COMMAND_LINE || failed
else else
eval echo `gettext '$APP_LONG_NAME is already running.'` eval echo `gettext '$APP_LONG_NAME is already running.'`
@ -1066,8 +1087,8 @@ start() {
create_config_dir create_config_dir
# The string passed to eval must handles spaces in paths correctly. # The string passed to eval must handles spaces in paths correctly.
COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP wrapper.script.version=3.5.22 $ADDITIONAL_PARA" COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.java.command=\"$JAVABINARY\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $COMMANDPROP $LOCKPROP $LOGPROP $ADDITIONAL_PARA"
eval $COMMAND_LINE eval $COMMAND_LINE || failed
else else
eval echo `gettext '$APP_LONG_NAME is already running.'` eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1 exit 1