"Ken McDonell" <kenj@xxxxxxxxxxxxxxxx> writes:
>> nc: getaddrinfo: Servname not supported for ai_socktype
> [...]
>> nc: getaddrinfo: Servname not supported for ai_socktype
The invocation of nc is:
nc -l localhost 2003 (or 2004)
Does your machine dns resolve "localhost" and/or port 200[34] in
/etc/services? Can you run "nc -v ..." for some verbosity? What
version of ncat does it identify?
Unfortunately, "nc" is not a very specific name for the tool; several
doppelgangers have made appearances over the years. If your machine
has "socat", we could switch to that instead - it's more of a fixed
quantity. That would look like this:
diff --git a/qa/667 b/qa/667
index e353fe546c4f..17c76f6e8fba 100755
--- a/qa/667
+++ b/qa/667
@@ -11,15 +11,16 @@ echo "QA output created by $seq"
. ./common.filter
. ./common.check
-which nc >/dev/null 2>&1 || _notrun "No nc binary installed"
+# which nc >/dev/null 2>&1 || _notrun "No nc binary installed"
+which socat >/dev/null 2>&1 || _notrun "No socat binary installed"
pcp2graphite --version 2>/dev/null || _notrun "python/modules missing"
-graphite_port=2004
-another_port=2003
-echo | $PCP_BINADM_DIR/telnet-probe localhost $graphite_port \
- && _notrun "Someone already listening on graphite port $graphite_port"
-echo | $PCP_BINADM_DIR/telnet-probe localhost $another_port \
- && _notrun "Someone already listening on second port $another_port"
+port_pickled=2004
+port_text=2003
+echo | $PCP_BINADM_DIR/telnet-probe localhost $port_pickled \
+ && _notrun "Someone already listening on graphite pickled port
$port_pickled"
+echo | $PCP_BINADM_DIR/telnet-probe localhost $port_text \
+ && _notrun "Someone already listening on graphite text port $port_text"
$sudo rm -rf $tmp.dir
rm -f $seq.full
@@ -39,7 +40,8 @@ ncpu=`pmprobe -v hinv.ncpu | awk '{print $3*'$scale'".0"}'`
echo | tee -a $seq.full
echo "=== 1. pcp2graphite one-shot pickle ===" | tee -a $seq.full
-nc -l localhost $graphite_port > $tmp.dir/test1.out &
+# nc -l localhost $port_pickled > $tmp.dir/test1.out &
+socat tcp-listen:$port_pickled,reuseaddr - > $tmp.dir/test1.out &
ncpid=$!
sleep 2
pcp2graphite -t 1 hinv.ncpu hinv.ncpu 2>/dev/null & # will error out after
nc dies
@@ -51,10 +53,11 @@ cat $tmp.dir/test1.out |
egrep -a hinv.ncpu
echo "=== 2. pcp2graphite text, 2-second aligned ===" | tee -a $seq.full
-nc -k -l localhost $another_port > $tmp.dir/test2.out &
+# nc -k -l localhost $port_text > $tmp.dir/test2.out &
+socat tcp-listen:$port_text,reuseaddr,fork - > $tmp.dir/test2.out &
ncpid=$!
sleep 2
-pcp2graphite -t 2 -P $another_port -u "/$scale" -m foobar. hinv.ncpu
2>/dev/null &
+pcp2graphite -t 2 -P $port_text -u "/$scale" -m foobar. hinv.ncpu 2>/dev/null &
p2gpid=$!
sleep 5 # enough for at least 2 messages
$signal $ncpid $p2gpid 2>/dev/null
- FChE
|