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

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

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 3.4.5
    • None
    • scripts
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment