Your first line of attack should always be to check the log files. The Samba log files can help diagnose the vast majority of the problems that beginning to intermediate Samba administrators are likely to face. Samba is quite flexible when it comes to logging. You can set up the server to log as little or as much as you want. Substitution variables that allow you to isolate individual logs for each machine, share, or combination thereof.
By default, logs are placed in
samba_directory
/var/smbd.log and
samba_directory
/var/nmbd.log, where
samba_directory
is the location where Samba was installed (typically,
/usr/local/samba). As we mentioned in Chapter 4,
Disk Shares , you can override the location and name using the
log
file
configuration option in
smb.conf. This option accepts all of the substitution variables mentioned in Chapter 2,
Installing Samba on a Unix System, so you could easily have the server keep a separate log for each connecting client by specifying the following in the
[global]
section of
smb.conf :
log file = %m.log
Alternatively, you can specify a log directory to use with the
-l
flag on the command line. For example:
smbd -l /usr/local/var/samba
Another useful trick is to have the server keep a log for each service (share) that is offered, especially if you suspect a particular share is causing trouble. Use the
%S
variable to set this up in the
[global]
section of the configuration file:
log file = %S.log