diff options
author | Simo Sorce <idra@samba.org> | 2008-11-20 08:16:52 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-11-20 08:21:05 -0500 |
commit | edd05ae9d671c9209d630c68a1aff5c5cca8ee32 (patch) | |
tree | df9e496fc18e35f3216cb4380ce252f14676a01e /server/providers | |
parent | ef946eebf0520607c1c7c72c80b51de63d9d941e (diff) | |
download | sssd-edd05ae9d671c9209d630c68a1aff5c5cca8ee32.tar.gz sssd-edd05ae9d671c9209d630c68a1aff5c5cca8ee32.tar.bz2 sssd-edd05ae9d671c9209d630c68a1aff5c5cca8ee32.zip |
Start conversion from a fork() and live to a fork()/exec() model.
To start the dameon now you need to pass the option -s monitor
Still have some problems communicating with children.
Diffstat (limited to 'server/providers')
-rw-r--r-- | server/providers/data_provider.c | 40 | ||||
-rw-r--r-- | server/providers/data_provider.h | 1 | ||||
-rw-r--r-- | server/providers/providers.h | 4 |
3 files changed, 21 insertions, 24 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index 43c80128..df9cfdf6 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -367,48 +367,44 @@ done: return ret; } -void dp_task_init(struct task_server *task) +int dp_process_init(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct confdb_ctx *cdb) { struct dp_ctx *dpctx; int ret; - task_server_set_title(task, "sssd[datap]"); - - dpctx = talloc_zero(task, struct dp_ctx); + dpctx = talloc_zero(mem_ctx, struct dp_ctx); if (!dpctx) { - task_server_terminate(task, "fatal error initializing dp_ctx\n"); - return; - } - dpctx->ev = task->event_ctx; - dpctx->task = task; - - ret = confdb_init(task, task->event_ctx, &dpctx->cdb); - if (ret != EOK) { - task_server_terminate(task, "fatal error initializing confdb\n"); - return; + DEBUG(0, ("fatal error initializing dp_ctx\n")); + return ENOMEM; } + dpctx->ev = ev; + dpctx->cdb = cdb; ret = dp_db_init(dpctx); if (ret != EOK) { - task_server_terminate(task, "fatal error opening database\n"); - return; + DEBUG(0, ("fatal error opening database\n")); + return ret; } ret = dp_monitor_init(dpctx); if (ret != EOK) { - task_server_terminate(task, "fatal error setting up monitor bus\n"); - return; + DEBUG(0, ("fatal error setting up monitor bus\n")); + return ret; } ret = dp_srv_init(dpctx); if (ret != EOK) { - task_server_terminate(task, "fatal error setting up server bus\n"); - return; + DEBUG(0, ("fatal error setting up server bus\n")); + return ret; } ret = init_data_providers(dpctx); if (ret != EOK) { - task_server_terminate(task, "fatal error initializing data providers\n"); - return; + DEBUG(0, ("fatal error initializing data providers\n")); + return ret; } + + return EOK; } diff --git a/server/providers/data_provider.h b/server/providers/data_provider.h index a5c0a417..36f92189 100644 --- a/server/providers/data_provider.h +++ b/server/providers/data_provider.h @@ -58,7 +58,6 @@ struct dp_sbus_ctx { struct dp_ctx { struct event_context *ev; - struct task_server *task; struct confdb_ctx *cdb; struct ldb_context *ldb; struct dp_sbus_ctx *sbus_ctx; diff --git a/server/providers/providers.h b/server/providers/providers.h index a1cc1fc4..19eab827 100644 --- a/server/providers/providers.h +++ b/server/providers/providers.h @@ -19,4 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -void dp_task_init(struct task_server *task); +int dp_process_init(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct confdb_ctx *cdb); |