1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

try netstat as a last attempt to check a tcp port in

ctdb_check_tcp_ports() as well

(This used to be ctdb commit ad0292726f9cfc8afe3733b30ac2d5621e9a48f1)
This commit is contained in:
Ronnie Sahlberg 2007-07-15 09:29:08 +10:00
parent 4c276ded1f
commit 8e89b27098

View 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"