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)
committerChristian Ambach <ambi@samba.org>
Thu, 30 Jun 2011 11:18:12 +0000 (13:18 +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

source3/smbd/server.c

index 5aa3ddbdc9aeca146b1b7da84a178c9065920ce8..03d971b9b40b0c11ed76ac7604d73d8f300a542b 100644 (file)
@@ -443,6 +443,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");
                }