Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1719

zkCli.sh, zkServer.sh and zkEnv.sh regression caused by ZOOKEEPER-1663

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.5, 3.5.0
    • Fix Version/s: 3.4.6, 3.5.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux (Ubuntu 12.04) with dash shell

      Description

      This fix from ZOOKEEPER-1663 is incorrect. It assumes the shell is bash since it uses bash array construction, e.g.:

       96   LIBPATH=("${ZOOKEEPER_PREFIX}"/share/zookeeper/*.jar)
      

      This does NOT work if /bin/sh points to /bin/dash as it does on Ubuntu.

      It fails as so:

      zkEnv.sh: 96: zkEnv.sh: Syntax error: "(" unexpected (expecting "fi")

      If I change the shebang at the top to use "/bin/bash" instead of "/bin/sh" it works as expected. I don't know the full details of why using a bash array was chosen as the solution but I don't think it is the right way to deal with spaces in these paths...

        Attachments

        1. ZOOKEEPER-1719.patch
          1 kB
          Marshall McMullen

          Activity

            People

            • Assignee:
              marshall Marshall McMullen
              Reporter:
              marshall Marshall McMullen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: