Review Board 1.7.22


FLUME-1046: invoking flume-ng script from bin directory fails

Review Request #4449 - Created March 22, 2012 and submitted

Mike Percy
FLUME-1046
Reviewers
Flume
flume-git
Patch to fix issue where invoking flume-ng script as ./flume-ng causes FLUME_HOME to be incorrectly detected.

 

Diff revision 1 (Latest)

  1. bin/flume-ng: Loading...
bin/flume-ng
Revision f2c9256 New Change
[20] 212 lines
[+20]
213
  elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
213
  elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
214
    . /usr/lib/bigtop-utils/bigtop-detect-javahome
214
    . /usr/lib/bigtop-utils/bigtop-detect-javahome
215
  else
215
  else
216
    JAVA_DEFAULT=`type -p java`
216
    JAVA_DEFAULT=`type -p java`
217
    [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
217
    [ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
218
    JAVA_HOME=$(dirname $(dirname $JAVA_DEFAULT))
218
    JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
219
  fi
219
  fi
220
fi
220
fi
221

    
   
221

   
222
[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
222
[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
223

    
   
223

   
224
# figure out where the flume distribution is
224
# figure out where the flume distribution is
225
if [ -z "${FLUME_HOME}" ] ; then
225
if [ -z "${FLUME_HOME}" ] ; then
226
  FLUME_HOME=$(cd $(dirname $(dirname $0)); pwd)
226
  FLUME_HOME=$(cd $(dirname $0)/..; pwd)
227
fi
227
fi
228

    
   
228

   
229
# If the user hasn't overridden the classpath, build it from the dist lib dir
229
# If the user hasn't overridden the classpath, build it from the dist lib dir
230
if [ -z "${FLUME_CLASSPATH}" ] ; then
230
if [ -z "${FLUME_CLASSPATH}" ] ; then
231
  FLUME_CLASSPATH="${FLUME_HOME}/lib/*"
231
  FLUME_CLASSPATH="${FLUME_HOME}/lib/*"
[+20] [20] 22 lines
  1. bin/flume-ng: Loading...