ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-722

zkServer.sh uses sh's builtin echo on BSD, behaves incorrectly.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.1, 3.4.0
    • Component/s: scripts
    • Labels:
      None
    • Environment:

      Mac OS X

    • Hadoop Flags:
      Reviewed
    • Release Note:
      Fix zkServer.sh script for BSD systems.

      Description

      zkServer.sh output the PID of the zookeeper process with:
      echo -n $! > "$ZOOPIDFILE"

      This uses -n which sh's builtin echo does not support. From echo's manpage.
      <snip>
      Some shells may provide a builtin echo command which is similar or identical to this utility. Most notably, the builtin echo in sh(1) does not accept
      the -n option. Consult the builtin(1) manual page.
      </snip>

      This means that echo -n PID > ZOOPIDFILE will mean the contents of ZOOPIDFILE will be "-n PID". This stops zkServer.sh stop from working correctly.

      1. zk-722.diff
        0.4 kB
        Ivan Kelly

        Activity

        Mahadev konar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Resolution Fixed [ 1 ]
        Patrick Hunt made changes -
        Fix Version/s 3.3.1 [ 12314846 ]
        Fix Version/s 3.4.0 [ 12314469 ]
        Affects Version/s 3.3.0 [ 12313976 ]
        Henry Robinson made changes -
        Assignee Henry Robinson [ henryr ] Ivan Kelly [ ikelly ]
        Henry Robinson made changes -
        Status In Progress [ 3 ] Patch Available [ 10002 ]
        Henry Robinson made changes -
        Assignee Ivan Kelly [ ikelly ] Henry Robinson [ henryr ]
        Patrick Hunt made changes -
        Assignee Ivan Kelly [ ikelly ]
        Ivan Kelly made changes -
        Status Patch Available [ 10002 ] In Progress [ 3 ]
        Ivan Kelly made changes -
        Attachment zk-722.diff [ 12439463 ]
        Ivan Kelly made changes -
        Attachment zk-722.diff [ 12439471 ]
        Ivan Kelly made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Release Note Fix zkServer.sh script for BSD systems.
        Ivan Kelly made changes -
        Field Original Value New Value
        Attachment zk-722.diff [ 12439463 ]
        Ivan Kelly created issue -

          People

          • Assignee:
            Ivan Kelly
            Reporter:
            Ivan Kelly
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development