12

Is there a way to unambiguously get the running config of a samba daemon?

I can't find any reference to it in the manual. Of course you run testparm, but that would only show the validity of the explicit configuration; I would also like to the see the implicit config which is loaded

6
  • 1
    Why not just look at /etc/samba/smb.conf? That's samba's config file. Commented May 31, 2019 at 22:49
  • 1
    But I also want to see the things that are not explicitly stated in the config file
    – hbogert
    Commented Jun 1, 2019 at 6:24
  • 17
    testparm -v should show the default settings as well.
    – Thomas
    Commented Jun 1, 2019 at 10:18
  • 5
    my original problem is that I have two instances of samba on different nodes, same config files, same version, yet different behaviour. So I wanted to verify that the configs loaded "in mem", at runtime, are the same. Tbh, I am not sure how I can be more clear than using the term "running config". the testparm -v is enlightening, but still does not ask the running process for its running config. It's like asking for the current running firewall and you want me to look at e.g., /etc/iptables.save instead of invoking iptables -L
    – hbogert
    Commented Jun 1, 2019 at 20:34
  • 4
    Another valid reason for such a command would be to verify that on-the-fly edits to smb.conf have been hot-reloaded, as Samba should. In fact this is the reason I found my way to this question.
    – cyqsimon
    Commented Jul 2, 2021 at 7:34

1 Answer 1

0

Use smbcontrol to dump the runtime configuration:

smbcontrol all debug 10

That command sets the debug level to 10, which is very verbose.

Now check the logs, look for lines that start with params.c, as they often contain details about the loaded configuration:

grep "params.c" /var/log/samba/log.smbd

Good luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .