if we dont have nc or netcat, try using netstat as a final attempt to
authorRonnie Sahlberg <sahlberg@ronnie>
Sat, 14 Jul 2007 23:26:54 +0000 (09:26 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Sat, 14 Jul 2007 23:26:54 +0000 (09:26 +1000)
check for tcp ports

(the check for these tools should not really use hardcoded paths)

config/functions

index 1a6fc5c0c780617a52bcbdb941a05baaaa8bdf93..378d38ec027e4b3fc3a7d9ecd5b82b558e098db8 100644 (file)
@@ -69,8 +69,10 @@ ctdb_wait_tcp_ports() {
                  /usr/bin/netcat -z 127.0.0.1 $p || all_ok=0
              elif [ -x /usr/bin/nc ]; then
                  /usr/bin/nc -z 127.0.0.1 $p || all_ok=0
+             elif [ -x /usr/bin/netstat ]; then
+                 (/usr/bin/netstat -a -n | egrep "0.0.0.0:$p .*LISTEN") || all_ok=0
              else 
-                 echo "`date` netcat not found - cannot check tcp ports"
+                 echo "`date` - No tool to check tcp ports availabe. can not check in ctdb_wait_tcp_ports"
                  return
              fi
          done