From b852ad044b98c0c574c3420956e153055d46136d Mon Sep 17 00:00:00 2001 From: Gary Lockyer Date: Fri, 15 Sep 2017 07:09:23 +1200 Subject: source4/smbd: refactor the process model for prefork Refactor the process model code to allow the addition of a prefork process model. - Add a process context to contain process model specific state - Add a service details structure to allow service to indicate which process model options they can support. In the new code the services advertise the features they support to the process model. The process model context is plumbed through to allow the process model to keep track of the supported options, and any state the process model may require. Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam --- source4/ntp_signd/ntp_signd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/ntp_signd') diff --git a/source4/ntp_signd/ntp_signd.c b/source4/ntp_signd/ntp_signd.c index 7949dc2f3b0..0884d2f53b5 100644 --- a/source4/ntp_signd/ntp_signd.c +++ b/source4/ntp_signd/ntp_signd.c @@ -541,7 +541,8 @@ static void ntp_signd_task_init(struct task_server *task) &ntp_signd_stream_ops, "unix", address, NULL, lpcfg_socket_options(ntp_signd->task->lp_ctx), - ntp_signd); + ntp_signd, + ntp_signd->task->process_context); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("Failed to bind to %s - %s\n", address, nt_errstr(status))); @@ -554,5 +555,10 @@ static void ntp_signd_task_init(struct task_server *task) /* called at smbd startup - register ourselves as a server service */ NTSTATUS server_service_ntp_signd_init(TALLOC_CTX *ctx) { - return register_server_service(ctx, "ntp_signd", ntp_signd_task_init); + struct service_details details = { + .inhibit_fork_on_accept = true, + .inhibit_pre_fork = true + }; + return register_server_service(ctx, "ntp_signd", ntp_signd_task_init, + &details); } -- cgit v1.2.1