Score:0

Why does `testparm` ignore log level setting?

do flag

My typical procedure for configuring Samba is with a config file named /etc/samba/smb.conf.master. After configuration, I implement the changes with testparm -s /etc/samba/smb.conf.master > /etc/samba/smb.conf. But what I've found is that any setting of log level = [0..10] in /etc/samba/smb.conf.master is ignored and not output to /etc/samba/smb.conf. This doesn't mean the log files are completely empty. Instead, they are very bare minimum with just errors and warnings, as if the setting is default: log level = 1.

I've even tried setting the log level with the -d debug level option using testparm as follows. But this has no affect. The log level setting is still not passed to /etc/samba/smb.conf.

testparm -s -d 3 /etc/samba/smb.conf.master > /etc/samba/smb.conf

All this being said, my current solution is to directly edit /etc/samba/smb.conf after-the-fact and add my log level setting with log level = [0..10]. Subsequently, the level of logging is set as intended and reflected in the log files correctly.

With some research, the answer to this Stack Exchange question, Unable to modify log level in samba, says that you cannot use testparm to test this because it forces the log level to 2.

Is this is intended behavior? If so, why? And is there a better workflow so that I don't have to edit both files?

Ubuntu 22.04 LTS Server

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

Samba Version:

$ smbd -V
Version 4.15.13-Ubuntu
waltinator avatar
it flag
Try `log level = 10`. I think that setting includes 1-9, but I could be wrong.
mpboden avatar
do flag
@waltinator I’ve tried every log level, and none are passed through to `smb.conf` when using `testparm` as I’ve indicated
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.