summaryrefslogtreecommitdiff
path: root/ctdb/tcp
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-07-04 07:21:01 +1000
committerAmitay Isaacs <amitay@gmail.com>2012-07-26 22:10:54 +1000
commit3c5374a5c23cb163c2f379f4707997dde317ac56 (patch)
treeb73a81419475a3435949eeecc58766f03a943b4d /ctdb/tcp
parent65725d30d43ee1b386578f4200b3005f867fe4d8 (diff)
downloadsamba-3c5374a5c23cb163c2f379f4707997dde317ac56.tar.gz
ctdbd: Log a meaningful message if the nodes file/list is empty
Right now the message says it can't bind to any of the addresses... even when there aren't any! Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 553455b386aa7848a516a921dfc14eb87c8a3fc1)
Diffstat (limited to 'ctdb/tcp')
-rw-r--r--ctdb/tcp/tcp_connect.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index 2814201f924..c94b88f6709 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -281,6 +281,15 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
int sock_size;
struct tevent_fd *fde;
+ /* If there are no nodes, then it won't be possible to find
+ * the first one. Log a failure and short circuit the whole
+ * process.
+ */
+ if (ctdb->num_nodes == 0) {
+ DEBUG(DEBUG_CRIT,("No nodes available to attempt bind to - is the nodes file empty?\n"));
+ return -1;
+ }
+
/* We only need to serialize this if we dont yet know the node ip */
if (!ctdb->node_ip) {
/* in order to ensure that we don't get two nodes with the