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/nss | |
parent | ef946eebf0520607c1c7c72c80b51de63d9d941e (diff) | |
download | sssd-edd05ae9d671c9209d630c68a1aff5c5cca8ee32.tar.gz sssd-edd05ae9d671c9209d630c68a1aff5c5cca8ee32.tar.xz 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/nss')
-rw-r--r-- | server/nss/nsssrv.c | 42 | ||||
-rw-r--r-- | server/nss/nsssrv.h | 3 |
2 files changed, 20 insertions, 25 deletions
diff --git a/server/nss/nsssrv.c b/server/nss/nsssrv.c index 0181644d4..764de8460 100644 --- a/server/nss/nsssrv.c +++ b/server/nss/nsssrv.c @@ -413,49 +413,45 @@ done: return retval; } -void nss_task_init(struct task_server *task) +int nss_process_init(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct confdb_ctx *cdb) { struct nss_ctx *nctx; int ret; - task_server_set_title(task, "sssd[nsssrv]"); - - nctx = talloc_zero(task, struct nss_ctx); + nctx = talloc_zero(mem_ctx, struct nss_ctx); if (!nctx) { - task_server_terminate(task, "fatal error initializing nss_ctx\n"); - return; - } - nctx->ev = task->event_ctx; - nctx->task = task; - - ret = confdb_init(task, task->event_ctx, &nctx->cdb); - if (ret != EOK) { - task_server_terminate(task, "fatal error initializing confdb\n"); - return; + DEBUG(0, ("fatal error initializing nss_ctx\n")); + return ENOMEM; } + nctx->ev = ev; + nctx->cdb = cdb; ret = nss_init_domains(nctx); if (ret != EOK) { - task_server_terminate(task, "fatal error setting up domain map\n"); - return; + DEBUG(0, ("fatal error setting up domain map\n")); + return ret; } ret = nss_sbus_init(nctx); if (ret != EOK) { - task_server_terminate(task, "fatal error setting up message bus\n"); - return; + DEBUG(0, ("fatal error setting up message bus\n")); + return ret; } - ret = nss_ldb_init(nctx, nctx->ev, nctx->cdb, &nctx->lctx); + ret = nss_ldb_init(nctx, ev, cdb, &nctx->lctx); if (ret != EOK) { - task_server_terminate(task, "fatal error initializing nss_ctx\n"); - return; + DEBUG(0, ("fatal error initializing nss_ctx\n")); + return ret; } /* after all initializations we are ready to listen on our socket */ ret = set_unix_socket(nctx); if (ret != EOK) { - task_server_terminate(task, "fatal error initializing socket\n"); - return; + DEBUG(0, ("fatal error initializing socket\n")); + return ret; } + + return EOK; } diff --git a/server/nss/nsssrv.h b/server/nss/nsssrv.h index 5d49e79fe..cf07ad490 100644 --- a/server/nss/nsssrv.h +++ b/server/nss/nsssrv.h @@ -43,7 +43,6 @@ struct nss_sbus_ctx { struct nss_ctx { struct event_context *ev; - struct task_server *task; struct fd_event *lfde; int lfd; struct nss_ldb_ctx *lctx; @@ -76,7 +75,7 @@ struct cli_request { /* from nsssrv_packet.c */ int nss_packet_new(TALLOC_CTX *mem_ctx, size_t size, - enum sss_nss_command cmd, + enum sss_nss_command cmd, struct nss_packet **rpacket); int nss_packet_grow(struct nss_packet *packet, size_t size); int nss_packet_recv(struct nss_packet *packet, int fd); |