r17644: change the ldap server to always use the single process model. We are
authorAndrew Tridgell <tridge@samba.org>
Mon, 21 Aug 2006 01:25:20 +0000 (01:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:16:18 +0000 (14:16 -0500)
not aiming to produce a high performance parallel ldap server, so
better to reserve the extra CPUs on a SMP box for file serving.

source/ldap_server/ldap_server.c

index 9b4055f8cf674ef04960f47dc2f9a2303ffc5890..d48c0664d7ce15c84880af59be546393ed92a651 100644 (file)
@@ -31,6 +31,7 @@
 #include "smbd/service_task.h"
 #include "smbd/service_stream.h"
 #include "smbd/service.h"
+#include "smbd/process_model.h"
 #include "lib/tls/tls.h"
 #include "lib/messaging/irpc.h"
 #include "lib/ldb/include/ldb.h"
@@ -472,9 +473,14 @@ static void ldapsrv_task_init(struct task_server *task)
 {      
        struct ldapsrv_service *ldap_service;
        NTSTATUS status;
+       const struct model_ops *model_ops;
 
        task_server_set_title(task, "task[ldapsrv]");
 
+       /* run the ldap server as a single process */
+       model_ops = process_model_byname("single");
+       if (!model_ops) goto failed;
+
        ldap_service = talloc_zero(task, struct ldapsrv_service);
        if (ldap_service == NULL) goto failed;
 
@@ -491,11 +497,11 @@ static void ldapsrv_task_init(struct task_server *task)
                */
                for(i = 0; i < num_interfaces; i++) {
                        const char *address = iface_n_ip(i);
-                       status = add_socket(task->event_ctx, task->model_ops, address, ldap_service);
+                       status = add_socket(task->event_ctx, model_ops, address, ldap_service);
                        if (!NT_STATUS_IS_OK(status)) goto failed;
                }
        } else {
-               status = add_socket(task->event_ctx, task->model_ops, lp_socket_address(), ldap_service);
+               status = add_socket(task->event_ctx, model_ops, lp_socket_address(), ldap_service);
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }