[jira] [Assigned] (DRILL-4921) Scripts drill_config.sh, drillbit.sh, and drill-embedded fail when accessed via a symbolic link
[ https://issues.apache.org/jira/browse/DRILL-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Boaz Ben-Zvi reassigned DRILL-4921: --- Assignee: Boaz Ben-Zvi (was: Smidth Panchamia) > Scripts drill_config.sh, drillbit.sh, and drill-embedded fail when accessed > via a symbolic link > > > Key: DRILL-4921 > URL: https://issues.apache.org/jira/browse/DRILL-4921 > Project: Apache Drill > Issue Type: Bug > Components: Server >Affects Versions: 1.8.0 > Environment: The drill-embedded on the Mac; the other files on Linux >Reporter: Boaz Ben-Zvi >Assignee: Boaz Ben-Zvi >Priority: Minor > Fix For: 1.9.0 > > > 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` > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Assigned] (DRILL-4921) Scripts drill_config.sh, drillbit.sh, and drill-embedded fail when accessed via a symbolic link
[ https://issues.apache.org/jira/browse/DRILL-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zelaine Fong reassigned DRILL-4921: --- Assignee: Paul Rogers Assigning to Paul for code review. > Scripts drill_config.sh, drillbit.sh, and drill-embedded fail when accessed > via a symbolic link > > > Key: DRILL-4921 > URL: https://issues.apache.org/jira/browse/DRILL-4921 > Project: Apache Drill > Issue Type: Bug > Components: Server >Affects Versions: 1.8.0 > Environment: The drill-embedded on the Mac; the other files on Linux >Reporter: Boaz Ben-Zvi >Assignee: Paul Rogers >Priority: Minor > Fix For: 1.9.0 > > > 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` > -- This message was sent by Atlassian JIRA (v6.3.4#6332)