source4/smbd: refactor the process model for prefork
[bbaumbach/samba-autobuild/.git] / source4 / kdc / kdc-heimdal.c
index d5c721b605691fc02512008a1d5bfa73489903fb..788959a737ad18c104e3702c174d0e8a6aec2e00 100644 (file)
@@ -468,5 +468,20 @@ static void kdc_task_init(struct task_server *task)
 /* called at smbd startup - register ourselves as a server service */
 NTSTATUS server_service_kdc_init(TALLOC_CTX *ctx)
 {
-       return register_server_service(ctx, "kdc", kdc_task_init);
+       struct service_details details = {
+               .inhibit_fork_on_accept = true,
+               /* 
+                * Need to prevent pre-forking on kdc.
+                * The task_init function is run on the master process only
+                * and the irpc process name is registered in it's event loop.
+                * The child worker processes initialise their event loops on
+                * fork, so are not listening for the irpc event.
+                *
+                * The master process does not wait on that event context
+                * the master process is responsible for managing the worker
+                * processes not performing work.
+                */
+               .inhibit_pre_fork = true
+       };
+       return register_server_service(ctx, "kdc", kdc_task_init, &details);
 }