mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
Rework service init functions to pass down service name. This is
needed to change prefork behaviour based on what service is being
started.
Andrew Bartlett and David Disseldorp
(This used to be commit 0d830580e3
)
This commit is contained in:
@ -209,7 +209,7 @@ static void cldapd_task_init(struct task_server *task)
|
|||||||
*/
|
*/
|
||||||
static NTSTATUS cldapd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
static NTSTATUS cldapd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_ctx, lp_ctx, model_ops, cldapd_task_init);
|
return task_server_startup(event_ctx, lp_ctx, "cldap", model_ops, cldapd_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ static void dreplsrv_task_init(struct task_server *task)
|
|||||||
*/
|
*/
|
||||||
static NTSTATUS dreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
static NTSTATUS dreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_ctx, lp_ctx, model_ops, dreplsrv_task_init);
|
return task_server_startup(event_ctx, lp_ctx, "drepl", model_ops, dreplsrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -667,7 +667,7 @@ static NTSTATUS kdc_init(struct event_context *event_ctx,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_ctx, lp_ctx, model_ops, kdc_task_init);
|
return task_server_startup(event_ctx, lp_ctx, "kdc", model_ops, kdc_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called at smbd startup - register ourselves as a server service */
|
/* called at smbd startup - register ourselves as a server service */
|
||||||
|
@ -584,7 +584,7 @@ static NTSTATUS ldapsrv_init(struct event_context *event_context,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_context, lp_ctx, model_ops,
|
return task_server_startup(event_context, lp_ctx, "ldap", model_ops,
|
||||||
ldapsrv_task_init);
|
ldapsrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ static void nbtd_task_init(struct task_server *task)
|
|||||||
*/
|
*/
|
||||||
static NTSTATUS nbtd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
static NTSTATUS nbtd_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_ctx, lp_ctx,
|
return task_server_startup(event_ctx, lp_ctx, "nbt",
|
||||||
model_ops, nbtd_task_init);
|
model_ops, nbtd_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ static NTSTATUS dcesrv_init(struct event_context *event_context,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_context, lp_ctx,
|
return task_server_startup(event_context, lp_ctx, "rpc",
|
||||||
model_ops, dcesrv_task_init);
|
model_ops, dcesrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ static NTSTATUS smbsrv_init(struct event_context *event_context,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_context, lp_ctx,
|
return task_server_startup(event_context, lp_ctx, "smb",
|
||||||
model_ops, smbsrv_task_init);
|
model_ops, smbsrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ static void task_server_callback(struct event_context *event_ctx,
|
|||||||
*/
|
*/
|
||||||
NTSTATUS task_server_startup(struct event_context *event_ctx,
|
NTSTATUS task_server_startup(struct event_context *event_ctx,
|
||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
|
const char *service_name,
|
||||||
const struct model_ops *model_ops,
|
const struct model_ops *model_ops,
|
||||||
void (*task_init)(struct task_server *))
|
void (*task_init)(struct task_server *))
|
||||||
{
|
{
|
||||||
@ -96,7 +97,7 @@ NTSTATUS task_server_startup(struct event_context *event_ctx,
|
|||||||
state->task_init = task_init;
|
state->task_init = task_init;
|
||||||
state->model_ops = model_ops;
|
state->model_ops = model_ops;
|
||||||
|
|
||||||
model_ops->new_task(event_ctx, lp_ctx, task_server_callback, state);
|
model_ops->new_task(event_ctx, lp_ctx, service_name, task_server_callback, state);
|
||||||
|
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ static NTSTATUS websrv_init(struct event_context *event_context,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_context, lp_ctx,
|
return task_server_startup(event_context, lp_ctx, "web",
|
||||||
model_ops, websrv_task_init);
|
model_ops, websrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ static NTSTATUS winbind_init(struct event_context *event_ctx,
|
|||||||
struct loadparm_context *lp_ctx,
|
struct loadparm_context *lp_ctx,
|
||||||
const struct model_ops *model_ops)
|
const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
return task_server_startup(event_ctx, lp_ctx,
|
return task_server_startup(event_ctx, lp_ctx, "winbind",
|
||||||
model_ops, winbind_task_init);
|
model_ops, winbind_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ static NTSTATUS wreplsrv_init(struct event_context *event_ctx, struct loadparm_c
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return task_server_startup(event_ctx, lp_ctx,
|
return task_server_startup(event_ctx, lp_ctx, "wrepl",
|
||||||
model_ops, wreplsrv_task_init);
|
model_ops, wreplsrv_task_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user