s3:smbd do not panic when CTDB is unhealthy (Bug #8278)
authorChristian Ambach <ambi@samba.org>
Wed, 29 Jun 2011 13:01:16 +0000 (15:01 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 4 Jul 2011 19:41:36 +0000 (21:41 +0200)
when CTDB is unhealthy, log a message and exit cleanly
instead of creating a core file

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Thu Jun 30 13:18:12 CEST 2011 on sn-devel-104
(cherry picked from commit 847ca0a5d791d881be8d9a0721bf30399c80013b)

source3/smbd/server.c

index f1aac81ccab49c34c6a1deff5e1da9a34377f13b..8ac0511f47771b3f02d9fbdf515e8ad05479767e 100644 (file)
@@ -477,6 +477,15 @@ static void smbd_accept_connection(struct tevent_context *ev,
                                         "because too many files are open\n"));
                                goto exit;
                        }
+                       if (lp_clustering() &&
+                           NT_STATUS_EQUAL(status,
+                           NT_STATUS_INTERNAL_DB_ERROR)) {
+                               DEBUG(1,("child process cannot initialize "
+                                        "because connection to CTDB "
+                                        "has failed\n"));
+                               goto exit;
+                       }
+
                        DEBUG(0,("reinit_after_fork() failed\n"));
                        smb_panic("reinit_after_fork() failed");
                }