diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-06-13 08:12:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:06 -0500 |
commit | 2b4791ae733488845b2c36bca64db695203de571 (patch) | |
tree | e6c3836a90b412e61b10d30f3b256092b46811c7 /source4/smbd | |
parent | 8fd5825a890db4f08966e4b262b03fb7868cc4c2 (diff) | |
download | samba-2b4791ae733488845b2c36bca64db695203de571.tar.gz samba-2b4791ae733488845b2c36bca64db695203de571.tar.bz2 samba-2b4791ae733488845b2c36bca64db695203de571.zip |
r7525: Unify lp_load(), load_interfaces and logging setup into popt().
There is now a new --debug-stderr option to enable debug to STDERR.
popt isn't perfect, but the callbacks are used in all the main Samba
binaries, and should be used in the rest. This avoids duplicated
code, and ensures every binary is setup correctly.
This also ensures the setup happens early enough to have -s function,
and have a correct impact on the credentials code. (Fixing a bug that
frustrated tridge earlier today).
The only 'subtle' aspect of all this is that I'm pretty sure that the
SAMBA_COMMON popt code must be above the CREDENTIALS code, in the
popt tables.
Andrew Bartlett
(This used to be commit 50f3c2b3a22971f40e0d3a88127b5120bfc47591)
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/server.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c index a08202baab..717de0c523 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -163,13 +163,13 @@ static int binary_smbd_main(int argc, const char *argv[]) int max_runtime = 0; struct poptOption long_options[] = { POPT_AUTOHELP - POPT_COMMON_SAMBA {"interactive", 'i', POPT_ARG_VAL, &interactive, True, "Run interactive (not a daemon)", NULL}, {"model", 'M', POPT_ARG_STRING, &model, True, "Select process model", "MODEL"}, {"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, True, "set maximum time for smbd to live", "seconds"}, + POPT_COMMON_SAMBA POPT_COMMON_VERSION POPT_TABLEEND }; @@ -180,15 +180,13 @@ static int binary_smbd_main(int argc, const char *argv[]) poptFreeContext(pc); - setup_logging(argv[0], interactive?DEBUG_STDOUT:DEBUG_FILE); + setup_logging(NULL, interactive?DEBUG_STDOUT:DEBUG_FILE); setup_signals(); /* we want total control over the permissions on created files, so set our umask to 0 */ umask(0); - reopen_logs(); - DEBUG(0,("smbd version %s started.\n", SAMBA_VERSION_STRING)); DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2005\n")); @@ -197,11 +195,6 @@ static int binary_smbd_main(int argc, const char *argv[]) exit(1); } - lp_load(dyn_CONFIGFILE, False, False, True); - - reopen_logs(); - load_interfaces(); - if (!interactive) { DEBUG(3,("Becoming a daemon.\n")); become_daemon(True); |