summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-04-14 10:22:20 -0400
committerSimo Sorce <ssorce@redhat.com>2009-04-14 13:50:49 -0400
commitac5a54e24ac79a33ddf8320811d981b950e21e8e (patch)
tree5c3597d6db83e990202b61ef8ed29a57b8546bc3
parent2f9fb5b8dcf09a3285386b8bade78bcd6867cb24 (diff)
downloadsssd-ac5a54e24ac79a33ddf8320811d981b950e21e8e.tar.gz
sssd-ac5a54e24ac79a33ddf8320811d981b950e21e8e.tar.bz2
sssd-ac5a54e24ac79a33ddf8320811d981b950e21e8e.zip
Make reconnection to the Data Provider a global setting
Previously, every DP client was allowed to set its own "retries" option. This option was ambiguous, and useless. All DP clients will now use a global option set in the services config called "reconnection_retries"
-rw-r--r--server/confdb/confdb.h2
-rw-r--r--server/examples/sssd.conf3
-rw-r--r--server/monitor/monitor.c2
-rw-r--r--server/providers/data_provider_be.c4
-rw-r--r--server/responder/nss/nsssrv.c7
-rw-r--r--server/responder/pam/pamsrv.c4
6 files changed, 12 insertions, 10 deletions
diff --git a/server/confdb/confdb.h b/server/confdb/confdb.h
index fda584c8..19614fc4 100644
--- a/server/confdb/confdb.h
+++ b/server/confdb/confdb.h
@@ -32,6 +32,8 @@
#define CONFDB_DEFAULT_CONFIG_FILE SSSD_CONF_DIR"/sssd.conf"
#define SSSD_MIN_ID 1000
+#define SERVICE_CONF_ENTRY "config/services"
+
struct confdb_ctx;
typedef int (*confdb_reconf_fn) (struct confdb_ctx *cdb, void *pvt);
diff --git a/server/examples/sssd.conf b/server/examples/sssd.conf
index b9a421ea..a480b549 100644
--- a/server/examples/sssd.conf
+++ b/server/examples/sssd.conf
@@ -1,6 +1,9 @@
[services]
description = Local Service Configuration
activeServices = nss, dp, pam
+# Number of times services should attempt to reconnect in the
+# event of a Data Provider crash or restart before they give up
+reconnection_retries = 3
[services/nss]
description = NSS Responder Configuration
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 69640b99..dd80830b 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -558,7 +558,7 @@ int get_monitor_config(struct mt_ctx *ctx)
}
ret = confdb_get_string(ctx->cdb, ctx,
- "config/services", "activeServices",
+ SERVICE_CONF_ENTRY, "activeServices",
NULL, &svcs);
if (ret != EOK || svcs == NULL) {
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c
index 3d824c39..6cd86e89 100644
--- a/server/providers/data_provider_be.c
+++ b/server/providers/data_provider_be.c
@@ -681,8 +681,8 @@ static int be_cli_init(struct be_ctx *ctx)
}
/* Enable automatic reconnection to the Data Provider */
- ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path,
- "retries", 3, &max_retries);
+ ret = confdb_get_int(ctx->cdb, ctx, SERVICE_CONF_ENTRY,
+ "reconnection_retries", 3, &max_retries);
if (ret != EOK) {
DEBUG(0, ("Failed to set up automatic reconnection\n"));
return ret;
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c
index 8e72a95c..e85e56b0 100644
--- a/server/responder/nss/nsssrv.c
+++ b/server/responder/nss/nsssrv.c
@@ -297,12 +297,9 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
}
/* Enable automatic reconnection to the Data Provider */
-
- /* FIXME: "retries" is too generic, either get it from a global config
- * or specify these retries are about the sbus connections to DP */
ret = confdb_get_int(nctx->rctx->cdb, nctx->rctx,
- nctx->rctx->confdb_service_path,
- "retries", 3, &max_retries);
+ SERVICE_CONF_ENTRY,
+ "reconnection_retries", 3, &max_retries);
if (ret != EOK) {
DEBUG(0, ("Failed to set up automatic reconnection\n"));
return ret;
diff --git a/server/responder/pam/pamsrv.c b/server/responder/pam/pamsrv.c
index 1adbb14c..e4ddc432 100644
--- a/server/responder/pam/pamsrv.c
+++ b/server/responder/pam/pamsrv.c
@@ -163,8 +163,8 @@ static int pam_process_init(struct main_context *main_ctx,
/* FIXME: "retries" is too generic, either get it from a global config
* or specify these retries are about the sbus connections to DP */
- ret = confdb_get_int(rctx->cdb, rctx, rctx->confdb_service_path,
- "retries", 3, &max_retries);
+ ret = confdb_get_int(rctx->cdb, rctx, SERVICE_CONF_ENTRY,
+ "reconnection_retries", 3, &max_retries);
if (ret != EOK) {
DEBUG(0, ("Failed to set up automatic reconnection\n"));
return ret;