various updates to i2prouter

- check status of i2psvc with ldd
- only warn about libiconv in FreeBSD if the package isn't installed. In recent
  versions of FreeBSD, OpenJDK depends on libiconv so it should always be
  available.
This commit is contained in:
kytv
2013-09-19 20:56:56 +00:00
parent ce2d0b0e12
commit 65b1124d81
2 changed files with 61 additions and 41 deletions

View File

@@ -203,20 +203,33 @@ failed() {
echo "**`gettext 'Failed to load the wrapper'`**"
case `uname -s` in
FreeBSD)
echo
echo "The wrapper requires libiconv to be on your system."
echo "It can be installed with pkg_add -r libiconv"
echo
exit 1
# We should never get here on recent versions of FreeBSD
if ! $(pkg_info -E 'libiconv*' > /dev/null 2>&1); then
echo
echo "The wrapper requires libiconv."
echo
echo "It can be installed with pkg_add -r libiconv"
echo
fi
;;
*)
echo
unsupported
exit 1
;;
esac
exit 1
}
if $(which ldd > /dev/null 2>&1); then
# This should cover every *NIX other than OSX since OSX doesn't have ldd.
# OSX has otool. Is otool on every OSX installation? Is otool's output the same as ldd's?
# The wrapper we ship for OSX are for PPC and Intel, so maybe we don't need to worry about OSX?
if (ldd "$WRAPPER_CMD" |grep -q 'not found') > /dev/null 2>&1 || \
! (ldd "$WRAPPER_CMD" > /dev/null 2>&1); then
failed
fi
fi
if [ -n "$FIXED_COMMAND" ]
then
COMMAND="$FIXED_COMMAND"
@@ -927,10 +940,7 @@ console() {
# 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.20 $ADDITIONAL_PARA"
eval $COMMAND_LINE
if [ "$?" -ne "0" ]; then
failed
fi
eval $COMMAND_LINE || failed
else
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1
@@ -987,7 +997,7 @@ startwait() {
if [ "X$pid" = "X" ]
then
eval echo " `gettext 'WARNING: $APP_LONG_NAME may have failed to start.'`"
exit 1
failed
else
eval echo ' running: PID:$pid'
fi
@@ -1054,9 +1064,6 @@ start() {
# 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.20 $ADDITIONAL_PARA"
eval $COMMAND_LINE
if [ "$?" -ne "0" ]; then
failed
fi
else
eval echo `gettext '$APP_LONG_NAME is already running.'`
exit 1