summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/cldap_server/cldap_server.c11
-rw-r--r--source4/cluster/cluster.h4
-rw-r--r--source4/dsdb/repl/drepl_service.c10
-rw-r--r--source4/kdc/kdc.c12
-rw-r--r--source4/ldap_server/ldap_server.c14
-rw-r--r--source4/lib/messaging/messaging.c4
-rw-r--r--source4/nbt_server/nbt_server.c12
-rw-r--r--source4/rpc_server/service_rpc.c14
-rw-r--r--source4/smb_server/smb_server.c14
-rw-r--r--source4/smbd/service.c11
-rw-r--r--source4/web_server/web_server.c14
-rw-r--r--source4/winbind/wb_server.c13
-rw-r--r--source4/wrepl_server/wrepl_server.c19
13 files changed, 25 insertions, 127 deletions
diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c
index 944d679a2d..7858ee2cf0 100644
--- a/source4/cldap_server/cldap_server.c
+++ b/source4/cldap_server/cldap_server.c
@@ -205,18 +205,9 @@ static void cldapd_task_init(struct task_server *task)
/*
- initialise the cldapd server
- */
-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, "cldap", model_ops, cldapd_task_init);
-}
-
-
-/*
register ourselves as a available server
*/
NTSTATUS server_service_cldapd_init(void)
{
- return register_server_service("cldap", cldapd_init);
+ return register_server_service("cldap", cldapd_task_init);
}
diff --git a/source4/cluster/cluster.h b/source4/cluster/cluster.h
index 203aef439c..7545757f2c 100644
--- a/source4/cluster/cluster.h
+++ b/source4/cluster/cluster.h
@@ -25,7 +25,9 @@
/*
test for same cluster id
*/
-#define cluster_id_equal(id1, id2) ((id1)->id == (id2)->id && (id1)->node == (id2)->node)
+#define cluster_id_equal(id_1, id_2) ((id_1)->id == (id_2)->id \
+ && (id_1)->id2 == (id_2)->id2 \
+ && (id_1)->node == (id_2)->node)
/*
test for same cluster node
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index 246309e16f..3375059e99 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -181,17 +181,9 @@ static void dreplsrv_task_init(struct task_server *task)
}
/*
- initialise the dsdb replicator service
- */
-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, "drepl", model_ops, dreplsrv_task_init);
-}
-
-/*
register ourselves as a available server
*/
NTSTATUS server_service_drepl_init(void)
{
- return register_server_service("drepl", dreplsrv_init);
+ return register_server_service("drepl", dreplsrv_task_init);
}
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index d820f0abe9..52ee475862 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -660,18 +660,8 @@ static void kdc_task_init(struct task_server *task)
}
-/*
- called on startup of the KDC service
-*/
-static NTSTATUS kdc_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, "kdc", model_ops, kdc_task_init);
-}
-
/* called at smbd startup - register ourselves as a server service */
NTSTATUS server_service_kdc_init(void)
{
- return register_server_service("kdc", kdc_init);
+ return register_server_service("kdc", kdc_task_init);
}
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index f9c763eec7..5b2519c035 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -576,20 +576,8 @@ failed:
task_server_terminate(task, "Failed to startup ldap server task");
}
-/*
- called on startup of the web server service It's job is to start
- listening on all configured sockets
-*/
-static NTSTATUS ldapsrv_init(struct event_context *event_context,
- struct loadparm_context *lp_ctx,
- const struct model_ops *model_ops)
-{
- return task_server_startup(event_context, lp_ctx, "ldap", model_ops,
- ldapsrv_task_init);
-}
-
NTSTATUS server_service_ldap_init(void)
{
- return register_server_service("ldap", ldapsrv_init);
+ return register_server_service("ldap", ldapsrv_task_init);
}
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 9cb10f961c..6a879ab962 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -121,8 +121,8 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg,
*/
static char *messaging_path(struct messaging_context *msg, struct server_id server_id)
{
- return talloc_asprintf(msg, "%s/msg.%u.%u", msg->base_path,
- (unsigned)server_id.node, (unsigned)server_id.id);
+ return talloc_asprintf(msg, "%s/msg.%s", msg->base_path,
+ cluster_id_string(msg, server_id));
}
/*
diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c
index bcdc63e984..2ac1fb4ef3 100644
--- a/source4/nbt_server/nbt_server.c
+++ b/source4/nbt_server/nbt_server.c
@@ -89,19 +89,9 @@ static void nbtd_task_init(struct task_server *task)
/*
- initialise the nbt server
- */
-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, "nbt",
- model_ops, nbtd_task_init);
-}
-
-
-/*
register ourselves as a available server
*/
NTSTATUS server_service_nbtd_init(void)
{
- return register_server_service("nbt", nbtd_init);
+ return register_server_service("nbt", nbtd_task_init);
}
diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c
index 855e120ced..ddcf1c2a99 100644
--- a/source4/rpc_server/service_rpc.c
+++ b/source4/rpc_server/service_rpc.c
@@ -457,18 +457,6 @@ failed:
task_server_terminate(task, "Failed to startup dcerpc server task");
}
-/*
- called on startup of the smb server service It's job is to start
- listening on all configured sockets
-*/
-static NTSTATUS dcesrv_init(struct event_context *event_context,
- struct loadparm_context *lp_ctx,
- const struct model_ops *model_ops)
-{
- return task_server_startup(event_context, lp_ctx, "rpc",
- model_ops, dcesrv_task_init);
-}
-
NTSTATUS server_service_rpc_init(void)
{
init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
@@ -479,5 +467,5 @@ NTSTATUS server_service_rpc_init(void)
talloc_free(shared_init);
- return register_server_service("rpc", dcesrv_init);
+ return register_server_service("rpc", dcesrv_task_init);
}
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index 866ae26fa4..9a8a8cf5c4 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -250,20 +250,8 @@ failed:
task_server_terminate(task, "Failed to startup smb server task");
}
-/*
- called on startup of the smb server service It's job is to start
- listening on all configured sockets
-*/
-static NTSTATUS smbsrv_init(struct event_context *event_context,
- struct loadparm_context *lp_ctx,
- const struct model_ops *model_ops)
-{
- return task_server_startup(event_context, lp_ctx, "smb",
- model_ops, smbsrv_task_init);
-}
-
/* called at smbd startup - register ourselves as a server service */
NTSTATUS server_service_smb_init(void)
{
- return register_server_service("smb", smbsrv_init);
+ return register_server_service("smb", smbsrv_task_init);
}
diff --git a/source4/smbd/service.c b/source4/smbd/service.c
index 525b245616..2b1fcc4bd8 100644
--- a/source4/smbd/service.c
+++ b/source4/smbd/service.c
@@ -30,20 +30,20 @@
static struct registered_server {
struct registered_server *next, *prev;
const char *service_name;
- NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *);
+ void (*task_init)(struct task_server *);
} *registered_servers;
/*
register a server service.
*/
NTSTATUS register_server_service(const char *name,
- NTSTATUS (*service_init)(struct event_context *, struct loadparm_context *lp_ctx, const struct model_ops *))
+ void (*task_init)(struct task_server *))
{
struct registered_server *srv;
srv = talloc(talloc_autofree_context(), struct registered_server);
NT_STATUS_HAVE_NO_MEMORY(srv);
srv->service_name = name;
- srv->service_init = service_init;
+ srv->task_init = task_init;
DLIST_ADD_END(registered_servers, srv, struct registered_server *);
return NT_STATUS_OK;
}
@@ -53,14 +53,15 @@ NTSTATUS register_server_service(const char *name,
initialise a server service
*/
static NTSTATUS server_service_init(const char *name,
- struct event_context *event_ctx,
+ struct event_context *event_context,
struct loadparm_context *lp_ctx,
const struct model_ops *model_ops)
{
struct registered_server *srv;
for (srv=registered_servers; srv; srv=srv->next) {
if (strcasecmp(name, srv->service_name) == 0) {
- return srv->service_init(event_ctx, lp_ctx, model_ops);
+ return task_server_startup(event_context, lp_ctx, srv->service_name,
+ model_ops, srv->task_init);
}
}
return NT_STATUS_INVALID_SYSTEM_SERVICE;
diff --git a/source4/web_server/web_server.c b/source4/web_server/web_server.c
index bd212cff7d..ac83a3384d 100644
--- a/source4/web_server/web_server.c
+++ b/source4/web_server/web_server.c
@@ -290,20 +290,8 @@ failed:
}
-/*
- called on startup of the web server service It's job is to start
- listening on all configured sockets
-*/
-static NTSTATUS websrv_init(struct event_context *event_context,
- struct loadparm_context *lp_ctx,
- const struct model_ops *model_ops)
-{
- return task_server_startup(event_context, lp_ctx, "web",
- model_ops, websrv_task_init);
-}
-
/* called at smbd startup - register ourselves as a server service */
NTSTATUS server_service_web_init(void)
{
- return register_server_service("web", websrv_init);
+ return register_server_service("web", websrv_task_init);
}
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 9acde4a557..9b303f3615 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -202,20 +202,9 @@ nomem:
}
/*
- initialise the winbind server
- */
-static NTSTATUS winbind_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, "winbind",
- model_ops, winbind_task_init);
-}
-
-/*
register ourselves as a available server
*/
NTSTATUS server_service_winbind_init(void)
{
- return register_server_service("winbind", winbind_init);
+ return register_server_service("winbind", winbind_task_init);
}
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index d13482dd98..e750d9355a 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -453,6 +453,10 @@ static void wreplsrv_task_init(struct task_server *task)
NTSTATUS status;
struct wreplsrv_service *service;
+ if (!lp_wins_support(task->lp_ctx)) {
+ return;
+ }
+
task_server_set_title(task, "task[wreplsrv]");
service = talloc_zero(task, struct wreplsrv_service);
@@ -502,22 +506,9 @@ static void wreplsrv_task_init(struct task_server *task)
}
/*
- initialise the WREPL server
- */
-static NTSTATUS wreplsrv_init(struct event_context *event_ctx, struct loadparm_context *lp_ctx, const struct model_ops *model_ops)
-{
- if (!lp_wins_support(lp_ctx)) {
- return NT_STATUS_OK;
- }
-
- return task_server_startup(event_ctx, lp_ctx, "wrepl",
- model_ops, wreplsrv_task_init);
-}
-
-/*
register ourselves as a available server
*/
NTSTATUS server_service_wrepl_init(void)
{
- return register_server_service("wrepl", wreplsrv_init);
+ return register_server_service("wrepl", wreplsrv_task_init);
}