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

zkServer.sh uses pattern unsupported by "grep" on Solaris

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.4.5
    • Fix Version/s: None
    • Component/s: scripts
    • Labels:
      None
    • Environment:

      Solaris 11

      Description

      The script "zkServer.sh" contains a pattern (POSIX "character class syntax") which is not supported by "grep" on Solaris (both versions 10 and 11).

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

      This results into the environment variable being set with an empty value, which later gives the following error :

      Starting zookeeper ... bin/zkServer.sh: line 114: /zookeeper_server.pid: Permission denied
      

      The workaround is to simplify the pattern used by "grep" :

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

      The same pattern is also used in the "status" command, which fails to read the "clientPort", which results into the following error :

      Error contacting service. It is probably not running.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cnauroth Chris Nauroth
                Reporter:
                metatech metatech
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: