accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject accumulo git commit: ACCUMULO-3952 Verify the log4j jar was found in the Hadoop installation.
Date Wed, 05 Aug 2015 16:33:39 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 774c2c7cf -> b8e19a4ac


ACCUMULO-3952 Verify the log4j jar was found in the Hadoop installation.

The `find` command may fail (personally, ran into this when the cwd
was a directory that was not readable by the user). We miss this
and blindly proceed. Presently, Accumulo processes will fail miserably
when log4j isn't present. Since the user _may_ add a log4j jar to the
CLASSPATH, we avoid erroring out when CLASSPATH is non-empty


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b8e19a4a
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b8e19a4a
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b8e19a4a

Branch: refs/heads/master
Commit: b8e19a4acfb21cc32b7268974f98c19b19b7ceb6
Parents: 774c2c7
Author: Josh Elser <elserj@apache.org>
Authored: Wed Aug 5 12:30:24 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Aug 5 12:30:24 2015 -0400

----------------------------------------------------------------------
 assemble/bin/accumulo | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b8e19a4a/assemble/bin/accumulo
----------------------------------------------------------------------
diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index 1bfaaad..1e29017 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -114,6 +114,14 @@ esac
 XML_FILES="${ACCUMULO_CONF_DIR}"
 LOG4J_JAR=$(find -H "${HADOOP_PREFIX}/lib" "${HADOOP_PREFIX}"/share/hadoop/common/lib -name
'log4j*.jar' -print 2>/dev/null | head -1)
 SLF4J_JARS="${ACCUMULO_HOME}/lib/slf4j-api.jar:${ACCUMULO_HOME}/lib/slf4j-log4j12.jar"
+
+# The `find` command could fail for environmental reasons or bad configuration
+# Avoid trying to run Accumulo when we can't find the jar
+if [ -z "${LOG4J_JAR}" -a -z "${CLASSPATH}" ]; then
+   echo "Could not locate Log4j jar in Hadoop installation at ${HADOOP_PREFIX}"
+   exit 1
+fi
+
 CLASSPATH="${XML_FILES}:${START_JAR}:${SLF4J_JARS}:${LOG4J_JAR}:${CLASSPATH}"
 
 if [ -z "${JAVA_HOME}" -o ! -d "${JAVA_HOME}" ]; then


Mime
View raw message