Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4921

Scripts drill_config.sh, drillbit.sh, and drill-embedded fail when accessed via a symbolic link

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.0
    • 1.9.0
    • Server
    • None
    • The drill-embedded on the Mac; the other files on Linux

    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`

      Attachments

        Activity

          People

            ben-zvi Boaz Ben-Zvi
            ben-zvi Boaz Ben-Zvi
            Krystal Krystal
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: