From 485898458a1f786febd400be30bb3917fe5f71eb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 18 Jul 2011 17:07:25 +1000 Subject: debug: log early messages to stdout, and keep it open The --log-stdout option was compromised by the log file descriptors being closed once the file process forked. Andrew Bartlett Signed-off-by: Andrew Tridgell --- source3/nmbd/nmbd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index d8a4b17a07..e8a8b0ead9 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -766,6 +766,8 @@ static bool open_sockets(bool isdaemon, int port) talloc_enable_null_tracking(); frame = talloc_stackframe(); + setup_logging(argv[0], DEBUG_DEFAULT_STDOUT); + load_case_tables(); global_nmb_port = NMB_PORT; @@ -840,8 +842,9 @@ static bool open_sockets(bool isdaemon, int port) DEBUG(0,("ERROR: Can't log to stdout (-S) unless daemon is in foreground (-F) or interactive (-i)\n")); exit(1); } + if (log_stdout) { - setup_logging( argv[0], DEBUG_STDOUT); + setup_logging(argv[0], DEBUG_STDOUT); } else { setup_logging( argv[0], DEBUG_FILE); } -- cgit