netcatを使用したDiscourse-setupで不正なオプションの組み合わせ?

Centos 7 で標準の discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub インストール手順を使用していますが、以下の状況です。

ポート 80 および 443 のネットワーク接続は、nc を使用して次のようにテストしています。

    echo -e "HTTP/1.1 200 OK\n\n $VERIFY" | nc -w 4 -l -p $PORT >/dev/null 2>&1 &
    if curl --proto =http -s $HOST:$PORT --connect-timeout 3 | grep $VERIFY >/dev/null 2>&1; then
:

しかし、nc は次のように失敗します。

nc: cannot use -p and -l

これにより、セットアップスクリプトがそれらのポートで利用不可を報告します。

man nc によると:

     -l      Listen for an incoming connection rather than initiating a connection to a remote host.  Cannot be used together with any of the options -psxz.  Additionally, any timeouts specified
             with the -w option are ignored.

これは nc のバージョン問題かもしれません。nc linux command man page を見ると、2 つのオプションの競合があるとは書かれていません。私の netcat はリッスンできますが、次のように使用する場合のみです。

nc -w 4 -l <IP address> <port number>

netcat のバージョン番号を取得できません :confused:

CentOSにはnetcat-traditionalが付属していますが、Discourseにはnetcat-openbsdが必要です。CentOSにnetcat-openbsdをインストールする方法は、簡単ではないようです。

手短に言うと:
yum remove netcat
yum install nmap-ncat

「いいね!」 2

それがUbuntuが推奨される理由の一部です。

しかし、2つのnetcatがあるのはどれほど迷惑でしょうか?そして、デフォルトのnetcatは特に使いにくいようです。

それを解明するのは大変でしたね!

「いいね!」 1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.