Bug 6211 - File logging in current version of samba4 is broken
File logging in current version of samba4 is broken
Product: Samba 4.0
Classification: Unclassified
Component: Other
Other Linux
: P3 normal
: ---
Assigned To: Andrew Bartlett
Andrew Bartlett
Depends on:
  Show dependency treegraph
Reported: 2009-03-25 04:54 UTC by Matthieu Patou
Modified: 2009-06-29 22:37 UTC (History)
2 users (show)

See Also:

Patch that solve the problem. (482 bytes, patch)
2009-03-25 04:57 UTC, Matthieu Patou
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Patou 2009-03-25 04:54:43 UTC
A regression has been introduced lately in samba4: file logging doesn't work anymore.

To reproduce the problem just start samba in daemon mode (/usr/local/samba/sbin/samba -D -M single or /usr/local/samba/sbin/samba --daemon), and notice that the logfile is not created.

I attached a patch that revert the regression.
Comment 1 Matthieu Patou 2009-03-25 04:57:44 UTC
Created attachment 4013 [details]
Patch that solve the problem.
Comment 2 Andrew Bartlett 2009-03-26 16:48:03 UTC
This looks possibly like a merge bug.  We will need to be careful not to break Samba3 in fixing it however
Comment 3 Matthias Dieter Wallnöfer 2009-04-16 04:50:51 UTC
Have we made some progress on this?
Comment 4 Andrew Kroeger 2009-06-01 03:14:49 UTC
This bug really needs to be fixed.  I came up with the same workaround as Matthieu shortly after the original change was made to the enum in debug.h.  It is becoming increasingly inconvenient to manage this patch in my local repo, and it's a real bummer when I create a new working branch and forget to cherry-pick the patch, only to find that I have no log file after a build, install, provision, ...

I just reviewed all callers of setup_logging() in the merged codebase, and only S4 calls the setup_logging() in lib/util/debug.c.  All S3 setup_logging() calls are calling the S3 version in source3/lib/debug.c, as that function takes a bool as the second argument.  Therefore, changing the enum back to its original value should not affect anything in S3.  Things will work properly in both S3 & S4 until an appropriate solution can be reviewed and tested.
Comment 5 Andrew Bartlett 2009-06-01 04:17:18 UTC
Can you point out the patch that broke this in the first place?

I'm happy to apply the fix, once I understand the original breakage.

Comment 6 Andrew Kroeger 2009-06-01 04:24:13 UTC
Commit 49a6d757b4d944cd22c91b2838beb83f04fbe1e9 (on 09-Jan-200) made the change to lib/util/debug.h.

The commit message talks about making things more compatible with S3, but this appears to be the only debugging-related patch made by metze that day, and lib/util/debug.h was the only file changed.
Comment 7 Andrew Bartlett 2009-06-01 04:58:11 UTC
The problem is that ndrdump calls setup_logging(), and will call it against either implementation.  The patch is correct, but we need to either merge Samba4's debug implemenation into Samba3, or have a different function that does the 'right thing' in both branches. 
Comment 8 Andrew Bartlett 2009-06-29 22:37:34 UTC
This should be fixed as of 6e92505080fd6764461563e4fdf1172be1ba2963