ctdb-scripts: Switch ctdb_check_unix_socket() to use ss
authorMartin Schwenke <martin@meltin.net>
Sat, 18 Mar 2017 10:55:04 +0000 (21:55 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 12 Sep 2017 10:23:19 +0000 (12:23 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index e31a095ab2743fb8f022bc9e152c801e4d0b3254..3805d480326cb53f26647209f105ae2173cbdd03 100755 (executable)
@@ -387,7 +387,8 @@ ctdb_check_unix_socket()
                return 1
        fi
 
-       if ! netstat --unix -a -n | grep -q "^unix.*LISTEN.*${_sockpath}$"; then
+       _out=$(ss -l -x "src ${_sockpath}" | tail -n +2)
+       if [ -z "$_out" ] ; then
                echo "ERROR: ${service_name} not listening on ${_sockpath}"
                return 1
        fi