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

Bug #1349384 reported by Martynas Sklizmantas on 2014-07-28
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to
Status tracked in 5.6
Fix Released
Fix Released

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

You will need openbsd-netcat for this.

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.

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

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

 diff --git a/garb/files/ b/garb/files/
 index 66d2d94..66df2a1 100755
 --- a/garb/files/
 +++ b/garb/files/
 @@ -124,7 +124,14 @@ start() {
                 HOST=$(echo $ADDRESS | cut -d \: -f 1 )
                 PORT=$(echo $ADDRESS | cut -d \: -f 2 )
 - 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
         if [ ${ADDRESS} == "0" ]; then
                 log_failure "None of the nodes in $GALERA_NODES is accessible"

no longer affects: galera

For nmap,

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

is required.

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers