]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
try netstat as a last attempt to check a tcp port in
authorRonnie Sahlberg <sahlberg@ronnie>
Sat, 14 Jul 2007 23:29:08 +0000 (09:29 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Sat, 14 Jul 2007 23:29:08 +0000 (09:29 +1000)
ctdb_check_tcp_ports() as well

(This used to be ctdb commit ad0292726f9cfc8afe3733b30ac2d5621e9a48f1)

ctdb/config/functions

index 378d38ec027e4b3fc3a7d9ecd5b82b558e098db8..2742d09848844a1c3ecf02e2f83747b9f8c5d587 100644 (file)
@@ -160,6 +160,8 @@ ctdb_check_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
       fi
       [ $all_ok -eq 1 ] || {
          echo "`date` ERROR: $service_name tcp port $p is not responding"