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

zkServer.sh fails to read dataDir (and others) from zoo.cfg on Solaris 10 (grep issue, manifests as FAILED TO WRITE PID).

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.6
    • 3.4.7, 3.5.3, 3.6.0
    • scripts
    • None
    • Solaris 5.10

    Description

      Fails to write PID file with a permissions error, because the startup script fails to read the dataDir variable from zoo.cfg, and then tries to use the drive root ( / ) as the data dir.

      Tracked the problem down to line 84 of zkServer.sh:

      ZOO_DATADIR="$(grep "^[[:space:]]dataDir" "$ZOOCFG" | sed -e 's/.=//')"

      If i run just that line and point it right at the config file, ZOO_DATADIR is empty.

      If I remove [[:space:]]* from the grep:

      ZOO_DATADIR="$(grep "^dataDir" "$ZOOCFG" | sed -e 's/.*=//')"

      Then it works fine. (If I also make the same change on line 164 and 169)

      My regex skills are pretty bad, so I'm afraid to comment on why [[space]]* needs to be in there?

      Attachments

        1. ZOOKEEPER-1927-branch-3.4.002.patch
          2 kB
          Chris Nauroth
        2. ZOOKEEPER-1927.002.patch
          4 kB
          Chris Nauroth
        3. ZOOKEEPER-1927.001.patch
          1 kB
          Chris Nauroth

        Issue Links

          Activity

            People

              cnauroth Chris Nauroth
              super_ed_9000 Ed Schmed
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: