summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-01-31 11:15:09 +0100
committerMichael Adam <obnox@samba.org>2013-10-17 23:20:45 +0200
commitfbee5795ab69a35c5440eb5684e4ca807b08b1e3 (patch)
tree7f02f1e07942399c14bc4084fe645f844c83cb47 /source3/lib
parent20d3f308e294c0ec616fa07570d9ba9254163d8f (diff)
downloadsamba-fbee5795ab69a35c5440eb5684e4ca807b08b1e3.tar.gz
samba-fbee5795ab69a35c5440eb5684e4ca807b08b1e3.tar.bz2
samba-fbee5795ab69a35c5440eb5684e4ca807b08b1e3.zip
smbd/winbindd: Do an early check if ctdbd is functional
This will avoid panic calls when smbd and winbind is started in cluster mode before ctdb is functional. It still logs something sane at debug level 0, but it does not panic and core anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/ctdbd_conn.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 70833cb91d..6ab4bbe704 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -1822,8 +1822,32 @@ NTSTATUS ctdb_unwatch(struct ctdbd_connection *conn)
return status;
}
+NTSTATUS ctdbd_probe(void)
+{
+ /*
+ * Do a very early check if ctdbd is around to avoid an abort and core
+ * later
+ */
+ struct ctdbd_connection *conn = NULL;
+ NTSTATUS status;
+
+ status = ctdbd_messaging_connection(talloc_tos(), &conn);
+
+ /*
+ * We only care if we can connect.
+ */
+ TALLOC_FREE(conn);
+
+ return status;
+}
+
#else
+NTSTATUS ctdbd_probe(void)
+{
+ return NT_STATUS_OK;
+}
+
NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const uint8_t *buf, size_t buflen)