summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-01-30 18:14:41 +0100
committerMichael Adam <obnox@samba.org>2009-01-30 22:45:52 +0100
commit77bd2b6c9173c2476988109f455612cdd34bb2ed (patch)
tree6d1758d029787fe293300e56082f01ec1708a525 /ctdb
parentbbf36eebb94fa28b17d94947cdeb2c6d8dc6ceb7 (diff)
downloadsamba-77bd2b6c9173c2476988109f455612cdd34bb2ed.tar.gz
samba-77bd2b6c9173c2476988109f455612cdd34bb2ed.tar.xz
samba-77bd2b6c9173c2476988109f455612cdd34bb2ed.zip
ctdb_check_tcp_ports: correctly detect listeners on ipv6 :::<port> w/out netcat
The netstat test only grepped for the ipv4 wildcard address. Now the ipv6 wildcard listener is correctly detected as well. Michael (This used to be ctdb commit 78e7928797e239e71f96eb001460a0dbf943e18f)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/config/functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 826febf158..ee48dd256e 100644
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -229,7 +229,11 @@ ctdb_check_tcp_ports() {
if [ "x${NETCAT}" != "x" ]; then
${NETCAT} -z 127.0.0.1 $p > /dev/null || all_ok=0
elif [ "x${NETSTAT}" != "x" ]; then
- ( ${NETSTAT} -a -n | egrep "0.0.0.0:$p .*LISTEN" > /dev/null ) || all_ok=0
+ if ! ${NETSTAT} -a -n | egrep "0.0.0.0:$p .*LISTEN" > /dev/null ; then
+ if ! ${NETSTAT} -a -n | egrep ":::$p .*LISTEN" > /dev/null ; then
+ all_ok=0
+ fi
+ fi
else
echo "ERROR: neither netcat (or nc) nor netstat found!"
echo "ERROR: can't monitor ${service_name} tcp port ${p}"