drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [6/9] drill git commit: DRILL-2446: Improvement in finding Drill log dir
Date Thu, 26 Mar 2015 17:51:12 GMT
DRILL-2446: Improvement in finding Drill log dir


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

Branch: refs/heads/master
Commit: ff3bab7d545638ffbf47b732e00fb6561d1867e4
Parents: c07e16f
Author: Patrick Wong <pwong@maprtech.com>
Authored: Thu Mar 12 14:48:05 2015 -0700
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Thu Mar 26 09:58:35 2015 -0700

----------------------------------------------------------------------
 distribution/src/resources/drill-config.sh | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/ff3bab7d/distribution/src/resources/drill-config.sh
----------------------------------------------------------------------
diff --git a/distribution/src/resources/drill-config.sh b/distribution/src/resources/drill-config.sh
index 0ee181d..7ddec65 100644
--- a/distribution/src/resources/drill-config.sh
+++ b/distribution/src/resources/drill-config.sh
@@ -78,20 +78,21 @@ fi
 . "${DRILL_CONF_DIR}/drill-env.sh"
 
 # get log directory
-if [ "$DRILL_LOG_DIR" = "" ]; then
-  DRILL_LOG_DIR=/var/log/drill
-  touch $DRILL_LOG_DIR/sqlline.log
-  TOUCH_EXIT_CODE=$?
-  if [ $TOUCH_EXIT_CODE = 0 ]; then
-    echo "Default Drill log directory: $DRILL_LOG_DIR"
-    DRILL_LOG_DIR_FALLBACK=0
-  else
-    #Force DRILL_LOG_DIR to fall back
-    DRILL_LOG_DIR_FALLBACK=1
-  fi
+if [ "x${DRILL_LOG_DIR}" = "x" ]; then
+  export DRILL_LOG_DIR=/var/log/drill
+fi
+
+touch "$DRILL_LOG_DIR/sqlline.log" &> /dev/null
+TOUCH_EXIT_CODE=$?
+if [ "$TOUCH_EXIT_CODE" = "0" ]; then
+  echo "Drill log directory: $DRILL_LOG_DIR"
+  DRILL_LOG_DIR_FALLBACK=0
+else
+  #Force DRILL_LOG_DIR to fall back
+  DRILL_LOG_DIR_FALLBACK=1
 fi
 
-if [ ! -d $DRILL_LOG_DIR ] || [ $DRILL_LOG_DIR_FALLBACK = 1 ]; then
+if [ ! -d "$DRILL_LOG_DIR" ] || [ "$DRILL_LOG_DIR_FALLBACK" = "1" ]; then
   echo "Drill log directory $DRILL_LOG_DIR does not exist or is not writable, defaulting
to $DRILL_HOME/log"
   DRILL_LOG_DIR=$DRILL_HOME/log
   mkdir -p $DRILL_LOG_DIR


Mime
View raw message