You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Roman Shaposhnik (Commented) (JIRA)" <ji...@apache.org> on 2011/12/23 01:47:31 UTC

[jira] [Commented] (ZOOKEEPER-1089) zkServer.sh status does not work due to invalid option of nc

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175204#comment-13175204 ] 

Roman Shaposhnik commented on ZOOKEEPER-1089:
---------------------------------------------

First of all I think that the confusion here is based on the fact that there are way too many versions of netcat in the wild (there's GNU netcat, OpenBSD netcat and fork of OpenBSD one just to name a few). In general, I'd try to avoid using nc for that reason -- it is difficult to do it in a portable way.

It would be really nice to come up with a POSIX compliant way of opening TCP socket from inside a script. Unfortunately, my browsing through the Opengroup spec didn't unearth much. As it stands, I'd say that we've got the following options:
  1. As Bill pointed out we can use bash, since the script requires bash already
  2. GNU awk also has support for opening a TCP connection
  3. ZK itself

Personally, I'd vote for including a very simple wrapper class into a ZK jar that would do what is expected to query a server. That also would take care of the less than ideal hack that is there to get clientPort data from the config.

Thoughts?
                
> zkServer.sh status does not work due to invalid option of nc
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1089
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1089
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.3.4, 3.4.0
>            Reporter: Bill Au
>            Assignee: Roman Shaposhnik
>
> The nc command used by zkServer.sh does not have the "-q" option on some linux versions ( I have checked RedHat/Fedora and FreeBSD).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira