Hadoop Common
  1. Hadoop Common
  2. HADOOP-7089

Fix link resolution logic in hadoop-config.sh

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.22.0, 0.23.0
    • Component/s: scripts
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Updates hadoop-config.sh to always resolve symlinks when determining HADOOP_HOME. Bash built-ins or POSIX:2001 compliant cmds are now required.

      Description

      The link resolution logic in bin/hadoop-config.sh fails when when executed via a symlink, from the root directory. We can replace this logic with cd -P and pwd -P, which should be portable across Linux, Solaris, BSD, and OSX.

      1. hadoop-7089-1.patch
        1 kB
        Eli Collins
      2. hadoop-7089-1.patch
        3 kB
        Eli Collins
      3. hadoop-7089-2.patch
        1.0 kB
        Eli Collins
      4. hadoop-7089-3.patch
        1 kB
        Eli Collins

        Issue Links

          Activity

          Eli Collins created issue -
          Eli Collins made changes -
          Field Original Value New Value
          Attachment hadoop-7089-1.patch [ 12467605 ]
          Eli Collins made changes -
          Link This issue relates to HDFS-1569 [ HDFS-1569 ]
          Eli Collins made changes -
          Link This issue relates to MAPREDUCE-2247 [ MAPREDUCE-2247 ]
          Eli Collins made changes -
          Attachment hadoop-7089-1.patch [ 12467609 ]
          Jeff Hammerbacher made changes -
          Link This issue is related to ZOOKEEPER-303 [ ZOOKEEPER-303 ]
          Eli Collins made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          Eli Collins made changes -
          Attachment hadoop-7089-2.patch [ 12467750 ]
          Eli Collins made changes -
          Description The manual link resolution logic in bin/hadoop-config.sh can be replaced with readlink -m -n. Ditto with other uses of cd + pwd to get an absolute path, which can be fragile. The link resolution logic in bin/hadoop-config.sh fails when when executed via a symlink, from the root directory. We can replace this logic with cd -P and pwd -P, which should be portable across Linux, Solaris, BSD, and OSX.
          Eli Collins made changes -
          Summary Use readlink to get absolute paths in the scripts Fix link resolution logic in hadoop-config.sh
          Thomas Koch made changes -
          Link This issue is related to HADOOP-7092 [ HADOOP-7092 ]
          Nigel Daley made changes -
          Fix Version/s 0.22.0 [ 12314296 ]
          Fix Version/s 0.23.0 [ 12315569 ]
          Eli Collins made changes -
          Attachment hadoop-7089-3.patch [ 12468354 ]
          Eli Collins made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Fix Version/s 0.22.0 [ 12314296 ]
          Fix Version/s 0.23.0 [ 12315569 ]
          Resolution Fixed [ 1 ]
          Eli Collins made changes -
          Release Note Updates hadoop-config.sh to always resolve symlinks when determining HADOOP_HOME. Bash built-ins or POSIX:2001 compliant cmds are now required.
          Eli Collins made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Eli Collins
              Reporter:
              Eli Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development