summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-18 18:05:55 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-18 18:05:55 -0700
commite9a589feac531379e569bc39d803b16179002cfa (patch)
tree81fcaf840fa0ed4513e4d17d6e20f47434ca5ac5 /source4/dsdb
parentade5d43c5ceb915dd2210a735a21fd9bed531dd3 (diff)
downloadsamba-e9a589feac531379e569bc39d803b16179002cfa.tar.gz
samba-e9a589feac531379e569bc39d803b16179002cfa.tar.bz2
samba-e9a589feac531379e569bc39d803b16179002cfa.zip
s4-server: kill main daemon if a task fails to initialise
When one of our core tasks fails to initialise it can now ask for the server as a whole to die, rather than limping along in a degraded state.
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/kcc/kcc_periodic.c2
-rw-r--r--source4/dsdb/kcc/kcc_service.c19
-rw-r--r--source4/dsdb/repl/drepl_notify.c2
-rw-r--r--source4/dsdb/repl/drepl_periodic.c2
-rw-r--r--source4/dsdb/repl/drepl_service.c18
5 files changed, 23 insertions, 20 deletions
diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c
index 3af79d8b89..dae0c1e235 100644
--- a/source4/dsdb/kcc/kcc_periodic.c
+++ b/source4/dsdb/kcc/kcc_periodic.c
@@ -172,7 +172,7 @@ static void kccsrv_periodic_handler_te(struct tevent_context *ev, struct tevent_
status = kccsrv_periodic_schedule(service, service->periodic.interval);
if (!W_ERROR_IS_OK(status)) {
- task_server_terminate(service->task, win_errstr(status));
+ task_server_terminate(service->task, win_errstr(status), true);
return;
}
}
diff --git a/source4/dsdb/kcc/kcc_service.c b/source4/dsdb/kcc/kcc_service.c
index 2279879000..32e09ac989 100644
--- a/source4/dsdb/kcc/kcc_service.c
+++ b/source4/dsdb/kcc/kcc_service.c
@@ -151,10 +151,10 @@ static void kccsrv_task_init(struct task_server *task)
switch (lp_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
- task_server_terminate(task, "kccsrv: no KCC required in standalone configuration");
+ task_server_terminate(task, "kccsrv: no KCC required in standalone configuration", false);
return;
case ROLE_DOMAIN_MEMBER:
- task_server_terminate(task, "kccsrv: no KCC required in domain member configuration");
+ task_server_terminate(task, "kccsrv: no KCC required in domain member configuration", false);
return;
case ROLE_DOMAIN_CONTROLLER:
/* Yes, we want a KCC */
@@ -165,7 +165,7 @@ static void kccsrv_task_init(struct task_server *task)
service = talloc_zero(task, struct kccsrv_service);
if (!service) {
- task_server_terminate(task, "kccsrv_task_init: out of memory");
+ task_server_terminate(task, "kccsrv_task_init: out of memory", true);
return;
}
service->task = task;
@@ -174,9 +174,10 @@ static void kccsrv_task_init(struct task_server *task)
status = kccsrv_init_creds(service);
if (!W_ERROR_IS_OK(status)) {
- task_server_terminate(task, talloc_asprintf(task,
- "kccsrv: Failed to obtain server credentials: %s\n",
- win_errstr(status)));
+ task_server_terminate(task,
+ talloc_asprintf(task,
+ "kccsrv: Failed to obtain server credentials: %s\n",
+ win_errstr(status)), true);
return;
}
@@ -184,7 +185,7 @@ static void kccsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"kccsrv: Failed to connect to local samdb: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -192,7 +193,7 @@ static void kccsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"kccsrv: Failed to load partitions: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -205,7 +206,7 @@ static void kccsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"kccsrv: Failed to periodic schedule: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
diff --git a/source4/dsdb/repl/drepl_notify.c b/source4/dsdb/repl/drepl_notify.c
index 73280917c5..d354b4e299 100644
--- a/source4/dsdb/repl/drepl_notify.c
+++ b/source4/dsdb/repl/drepl_notify.c
@@ -368,7 +368,7 @@ static void dreplsrv_notify_handler_te(struct tevent_context *ev, struct tevent_
status = dreplsrv_notify_schedule(service, service->notify.interval);
if (!W_ERROR_IS_OK(status)) {
- task_server_terminate(service->task, win_errstr(status));
+ task_server_terminate(service->task, win_errstr(status), false);
return;
}
}
diff --git a/source4/dsdb/repl/drepl_periodic.c b/source4/dsdb/repl/drepl_periodic.c
index 377cecbe99..61d5598207 100644
--- a/source4/dsdb/repl/drepl_periodic.c
+++ b/source4/dsdb/repl/drepl_periodic.c
@@ -46,7 +46,7 @@ static void dreplsrv_periodic_handler_te(struct tevent_context *ev, struct teven
status = dreplsrv_periodic_schedule(service, service->periodic.interval);
if (!W_ERROR_IS_OK(status)) {
- task_server_terminate(service->task, win_errstr(status));
+ task_server_terminate(service->task, win_errstr(status), false);
return;
}
}
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index 75ce42b91a..34853c85f9 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -138,10 +138,12 @@ static void dreplsrv_task_init(struct task_server *task)
switch (lp_server_role(task->lp_ctx)) {
case ROLE_STANDALONE:
- task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration");
+ task_server_terminate(task, "dreplsrv: no DSDB replication required in standalone configuration",
+ false);
return;
case ROLE_DOMAIN_MEMBER:
- task_server_terminate(task, "dreplsrv: no DSDB replication required in domain member configuration");
+ task_server_terminate(task, "dreplsrv: no DSDB replication required in domain member configuration",
+ false);
return;
case ROLE_DOMAIN_CONTROLLER:
/* Yes, we want DSDB replication */
@@ -152,7 +154,7 @@ static void dreplsrv_task_init(struct task_server *task)
service = talloc_zero(task, struct dreplsrv_service);
if (!service) {
- task_server_terminate(task, "dreplsrv_task_init: out of memory");
+ task_server_terminate(task, "dreplsrv_task_init: out of memory", true);
return;
}
service->task = task;
@@ -163,7 +165,7 @@ static void dreplsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"dreplsrv: Failed to obtain server credentials: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -171,7 +173,7 @@ static void dreplsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"dreplsrv: Failed to connect to local samdb: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -179,7 +181,7 @@ static void dreplsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"dreplsrv: Failed to load partitions: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -190,7 +192,7 @@ static void dreplsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"dreplsrv: Failed to periodic schedule: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}
@@ -200,7 +202,7 @@ static void dreplsrv_task_init(struct task_server *task)
if (!W_ERROR_IS_OK(status)) {
task_server_terminate(task, talloc_asprintf(task,
"dreplsrv: Failed to setup notify schedule: %s\n",
- win_errstr(status)));
+ win_errstr(status)), true);
return;
}