You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2015/03/26 18:51:12 UTC
[6/9] drill git commit: DRILL-2446: Improvement in finding Drill log
dir
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 <pw...@maprtech.com>
Authored: Thu Mar 12 14:48:05 2015 -0700
Committer: Jacques Nadeau <ja...@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