diff options
author | Simo Sorce <idra@samba.org> | 2008-11-25 16:45:11 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-11-25 19:49:18 -0500 |
commit | 6092cf59d7f5d1c0d915c65bde20fdc98f80c950 (patch) | |
tree | e3689b6e32d1079e38d00297395be3fbe2291169 /server/providers | |
parent | d4b9a588bade582ba2968f270101032a11981e17 (diff) | |
download | sssd-6092cf59d7f5d1c0d915c65bde20fdc98f80c950.tar.gz sssd-6092cf59d7f5d1c0d915c65bde20fdc98f80c950.tar.bz2 sssd-6092cf59d7f5d1c0d915c65bde20fdc98f80c950.zip |
Make a binary out of each major sssd component instead of
using the same binary to fork off all services.
Diffstat (limited to 'server/providers')
-rw-r--r-- | server/providers/data_provider.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c index aacb09ef..bfc37a7c 100644 --- a/server/providers/data_provider.c +++ b/server/providers/data_provider.c @@ -29,6 +29,7 @@ #include <string.h> #include <sys/time.h> #include <errno.h> +#include "popt.h" #include "ldb.h" #include "ldb_errors.h" #include "util/util.h" @@ -397,3 +398,45 @@ int dp_process_init(TALLOC_CTX *mem_ctx, return EOK; } + +int main(int argc, const char *argv[]) +{ + int opt; + poptContext pc; + struct main_context *main_ctx; + int ret; + + struct poptOption long_options[] = { + POPT_AUTOHELP + SSSD_MAIN_OPTS + { NULL } + }; + + pc = poptGetContext(argv[0], argc, argv, long_options, 0); + while((opt = poptGetNextOpt(pc)) != -1) { + switch(opt) { + default: + fprintf(stderr, "\nInvalid option %s: %s\n\n", + poptBadOption(pc, 0), poptStrerror(opt)); + poptPrintUsage(pc, stderr, 0); + return 1; + } + } + + poptFreeContext(pc); + + /* set up things like debug , signals, daemonization, etc... */ + ret = server_setup("sssd[dp]", 0, &main_ctx); + if (ret != EOK) return 2; + + ret = dp_process_init(main_ctx, + main_ctx->event_ctx, + main_ctx->confdb_ctx); + if (ret != EOK) return 3; + + /* loop on main */ + server_loop(main_ctx); + + return 0; +} + |