HIVE-16769: Possible hive service startup due to the existing file /tmp/stderr (Aihua Xu, reviewed by Naveen Gangam)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9f976fff Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9f976fff Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9f976fff Branch: refs/heads/hive-14535 Commit: 9f976ffff343a891c9d3e8d5fa0e70b2c622ff1a Parents: 3f5e652 Author: Aihua Xu <[email protected]> Authored: Wed May 31 17:08:29 2017 -0400 Committer: Aihua Xu <[email protected]> Committed: Fri Jun 2 09:21:39 2017 -0400 ---------------------------------------------------------------------- bin/ext/version.sh | 2 +- bin/hive | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/9f976fff/bin/ext/version.sh ---------------------------------------------------------------------- diff --git a/bin/ext/version.sh b/bin/ext/version.sh index b6a237b..92fee3d 100644 --- a/bin/ext/version.sh +++ b/bin/ext/version.sh @@ -27,7 +27,7 @@ version () { # hadoop 20 or newer - skip the aux_jars option and hiveconf CLASS=org.apache.hive.common.util.HiveVersionInfo - exec $HADOOP jar $JAR $CLASS 2>> ${STDERR} + exec $HADOOP jar $JAR $CLASS 2>&2 } version_help () { http://git-wip-us.apache.org/repos/asf/hive/blob/9f976fff/bin/hive ---------------------------------------------------------------------- diff --git a/bin/hive b/bin/hive index a7671c3..4a908e1 100755 --- a/bin/hive +++ b/bin/hive @@ -25,8 +25,6 @@ bin=`cd "$bin"; pwd` . "$bin"/hive-config.sh -TMP_USER_DIR="/tmp/${USER}" -STDERR="${TMP_USER_DIR}/stderr" SERVICE="" HELP="" SKIP_HBASECP=false @@ -227,24 +225,10 @@ if [ ! -f ${HADOOP} ]; then exit 4; fi -if [ ! -d ${TMP_USER_DIR} ]; then - mkdir -p ${TMP_USER_DIR} 2> /dev/null - if [ $? -ne 0 ]; then - STDERR="/dev/tty" - fi -fi - -if [ "${STDERR}" != "/dev/null" ] && [ ! -f ${STDERR} ]; then - touch ${STDERR} 2> /dev/null - if [ $? -ne 0 ]; then - STDERR="/dev/tty" - fi -fi - if [ "$SKIP_HADOOPVERSION" = false ]; then # Make sure we're using a compatible version of Hadoop if [ "x$HADOOP_VERSION" == "x" ]; then - HADOOP_VERSION=$($HADOOP version 2>> ${STDERR} | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2); + HADOOP_VERSION=$($HADOOP version 2>&2 | awk -F"\t" '/Hadoop/ {print $0}' | cut -d' ' -f 2); fi # Save the regex to a var to workaround quoting incompatabilities @@ -295,7 +279,7 @@ if [ "$SKIP_HBASECP" = false ]; then if [[ -n $HBASE_BIN ]] ; then # exclude ZK, PB, and Guava (See HIVE-2055) # depends on HBASE-8438 (hbase-0.94.14+, hbase-0.96.1+) for `hbase mapredcp` command - for x in $($HBASE_BIN mapredcp 2>> ${STDERR} | tr ':' '\n') ; do + for x in $($HBASE_BIN mapredcp 2>&2 | tr ':' '\n') ; do if [[ $x == *zookeeper* || $x == *protobuf-java* || $x == *guava* ]] ; then continue fi
