From fbee5795ab69a35c5440eb5684e4ca807b08b1e3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 31 Jan 2013 11:15:09 +0100 Subject: 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 Reviewed-by: Michael Adam --- source3/smbd/server.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/smbd') diff --git a/source3/smbd/server.c b/source3/smbd/server.c index d3cd33ec90..3536f18cf4 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1214,6 +1214,17 @@ extern void build_options(bool screen); exit(1); } + if (lp_clustering()) { + NTSTATUS status; + + status = ctdbd_probe(); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("clustering=yes but ctdbd connect failed: " + "%s\n", nt_errstr(status))); + exit(1); + } + } + /* Init the security context and global current_user */ init_sec_ctx(); -- cgit