Details
Description
Several of the drill... scripts under $DRILL_HOME/bin use "pwd" to produce the local path of that script. However "pwd" defaults to "logical" (i.e. the same as "pwd -L"); so if accessed via a symbolic link, that link is used verbatim in the path, which can produce wrong paths (e.g., when followed by "cd ..").
For example, creating a symbolic link and using it (on the Mac):
$ cd ~/drill
$ ln -s $DRILL_HOME/bin
$ bin/drill-embedded
ERROR: Drill config file missing: /Users/boazben-zvi/drill/conf/drill-override.conf – Wrong config dir?
Similarly on Linux the CLASS_PATH gets set wrong (when running "drillbit.sh start" via a symlink).
Solution: need to replace all the "pwd" in all the scripts with "pwd -P" which produces the Physical path. (Or replace a preceding "cd" with "cd -P" which does the same).
Relevant scripts:
=============
$ cd bin; grep pwd *
drillbit.sh:bin=`cd "$bin">/dev/null; pwd`
drillbit.sh: echo "cwd:" `pwd`
drill-conf:bin=`cd "$bin">/dev/null; pwd`
drill-config.sh:home=`cd "$bin/..">/dev/null; pwd`
drill-config.sh: DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
drill-config.sh: JAVA_HOME="$( cd -P "$( dirname "$SOURCE" )" && cd .. && pwd )"
drill-embedded:bin=`cd "$bin">/dev/null; pwd`
drill-localhost:bin=`cd "$bin">/dev/null; pwd`
submit_plan:bin=`cd "$bin">/dev/null; pwd`