garb: nc: invalid option -- 'z' on centos 7

Bug #1349384 reported by Martynas Sklizmantas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

cannot run garbd on centos 7, it fails with:

garb[]: nc: invalid option -- 'z'
garb[]: Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING.

nc provided with nmap-ncat-6.40-4.el7.x86_64 package

Tags: garb
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

You will need openbsd-netcat for this.

Revision history for this message
Martynas Sklizmantas (saint-ghost) wrote :

it is not available in default repositories and epel. are you suggesting to use other 3d party repos? the garbd package should fail dependency check upon install i think.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

nc available in base has the -z option in centos6.

However, in centos7 it is not available and nmap-ncat has replaced it.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

 diff --git a/garb/files/garb.sh b/garb/files/garb.sh
 index 66d2d94..66df2a1 100755
 --- a/garb/files/garb.sh
 +++ b/garb/files/garb.sh
 @@ -124,7 +124,14 @@ start() {
                 HOST=$(echo $ADDRESS | cut -d \: -f 1 )
                 PORT=$(echo $ADDRESS | cut -d \: -f 2 )
                 PORT=${PORT:-$GALERA_PORT}
 - nc -z $HOST $PORT >/dev/null && break
 + if nc -h 2>&1 | grep -q -- '-z';then
 + nc -z $HOST $PORT >/dev/null && break
 + elif [[ -x `which nmap` ]];then
 + nmap -Pn -p$PORT $HOST | grep -q 'Host is up' && break
 + else
 + log_failure "Neither netcat nor nmap are present for zero I/O scanning"
 + return 1
 + fi
         done
         if [ ${ADDRESS} == "0" ]; then
                 log_failure "None of the nodes in $GALERA_NODES is accessible"

no longer affects: galera
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

For nmap,

nmap -Pn -p$PORT $HOST | awk "\$1 ~ /$PORT/ {print \$2}" | grep open

is required.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1709

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.