summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-07-18 17:07:25 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-07-20 09:17:09 +1000
commit485898458a1f786febd400be30bb3917fe5f71eb (patch)
tree9ec865e0baddf3e65960e329a812f35bd3a093b1 /source3/smbd
parent3c9d01e3e58e2217915317406541ac8c6f6dcf92 (diff)
downloadsamba-485898458a1f786febd400be30bb3917fe5f71eb.tar.gz
samba-485898458a1f786febd400be30bb3917fe5f71eb.tar.bz2
samba-485898458a1f786febd400be30bb3917fe5f71eb.zip
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 <tridge@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 6fc2a14fc4..f51565a411 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -428,7 +428,9 @@ static void smbd_accept_connection(struct tevent_context *ev,
/* close our standard file
descriptors */
- close_low_fds(False);
+ if (!debug_get_output_is_stdout()) {
+ close_low_fds(False); /* Don't close stderr */
+ }
/*
* Can't use TALLOC_FREE here. Nulling out the argument to it
@@ -910,6 +912,8 @@ extern void build_options(bool screen);
talloc_enable_null_tracking();
frame = talloc_stackframe();
+ setup_logging(argv[0], DEBUG_DEFAULT_STDOUT);
+
load_case_tables();
smbd_init_globals();
@@ -1287,7 +1291,9 @@ extern void build_options(bool screen);
smbd_server_conn->sock = dup(0);
/* close our standard file descriptors */
- close_low_fds(False); /* Don't close stderr */
+ if (!debug_get_output_is_stdout()) {
+ close_low_fds(False); /* Don't close stderr */
+ }
#ifdef HAVE_ATEXIT
atexit(killkids);