Bug 10768 - smbcontrol smbd debug level does not act like increasing log level in smb.conf
Summary: smbcontrol smbd debug level does not act like increasing log level in smb.conf
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.1.11
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-12 19:12 UTC by John Mulligan (dead mail address)
Modified: 2014-08-12 19:14 UTC (History)
0 users

See Also:


Attachments
sample log files (24.72 KB, application/x-bzip)
2014-08-12 19:14 UTC, John Mulligan (dead mail address)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Mulligan (dead mail address) 2014-08-12 19:12:07 UTC
On Samba 3.6.x we regularly increased the log level on the fly using the 'smbcontrol smbd debug N', and it generally gave the same output in the log.smbd file. However, when running the same command on 4.1.x I've found that it does not quite seem to match the behavior of 3.6. Far fewer log lines end up in the log.

Capturing logging during a fairly simple 'ls' operation with smbclient shows that the number of log lines captured are fairly similar on 3.6 but very different on 4.1.

[3.6]$ wc -l *txt
  1787 3622log_sample_config0+smbcontrol9.txt
  1789 3622log_sample_config9.txt

[4.1]$ wc -l *txt
   454 4111log_sample_config0+smbcontrol9.txt
  3161 4111log_sample_config9.txt

I created the files with the following script:

###############
SHARE=g1
service smb stop
echo > /var/log/samba/log.smbd
service smb start
sleep 1

LL=$(grep 'log level' /etc/samba/smb.conf |cut -d= -f2 |sed 's/ //')
SUFFIX="config$LL"

if [ "$SMB_CONTROL" = 1 ]; then
    echo "using smbcontrol"
    SUFFIX="$SUFFIX+smbcontrol9"
    smbcontrol smbd debug 9
fi

tail -F /var/log/samba/log.smbd > log_sample_${SUFFIX}.txt &
echo ls | smbclient -U 'engwin2k8\johnm%Xxxxxxx1' //localhost/$SHARE
sleep 1
kill %1
##################

Our Samba build is an rpm we compile from sources. I am attaching the log samples I mentioned above to the bug. I decided this was worth a bug because the results are so radically different on the two versions. It was extremely handy to use smbcontrol to change the log level in the field, and so if this was intentional I'd like to humbly ask for the old behavior again. :-)

If there's any other information I can provide please let me know. I have not checked to see if winbind behaves similarly, as I haven't needed to increase the logging on that server as often.
Comment 1 John Mulligan (dead mail address) 2014-08-12 19:14:28 UTC
Created attachment 10196 [details]
sample log files