SAMBA Debug |
The standard process for debugging samba via the smb.conf file is as follows:
1. cd to /etc/samba directory: “cd /etc/samba”.
2. Make a backup of the conf file: “cp smb.conf smb.conf.orig”.
3. Edit file /etc/samba/smb.conf file with vi: “ vi smb.conf”.
4. Add line “debug level = 10 “ to the [global] section of smb.conf.
EXAMPLE:
[global]
server string = Flames File Server
workgroup =
security = user
netbios name = FLAMES
domain master = no
local master = no
dos filemode = yes
name cache timeout = 0
passdb backend = smbpasswd:/snfs/common/galaxy-config/nas/smbpasswd
debug level = 10
5. Save the file, then run command “service smb restart” to cycle smb.
6. This will log information in: /var/log/samba/log* files.
Using the same process, set debug to 10 in "/snfs/common/galaxy-config/nas/smb.conf.extra" to diagnose smb restart issues.
Additionally, you can also use smbcontrol.
To alter samba debug level on the fly with no need to cycle smb (default debug level is 0):
smbcontrol smbd debug #
# = the debug level.
To check samba debug level:
smbcontrol smbd debuglevel
Examples:
[root@P-DXi6902 ~]# smbcontrol smbd debug 0
Tail of /var/log/samba/log.samba:
[2016/01/25 11:46:13.088790, 3, pid=16656, effective(0, 0), real(0, 0)] ../lib/util/debug_s3.c:72(debug_message)
INFO: Remote set of debug to `0' (pid 16656 from pid 32028)
[root@P-DXi6902 ~]# smbcontrol smbd debug 10
Tail of /var/log/samba/log.samba:
2016/01/25 11:48:36.117501, 3, pid=16656] ../lib/util/debug_s3.c:72(debug_message)
INFO: Remote set of debug to `10' (pid 16656 from pid 32028)
[2016/01/25 11:54:54.325349, 10, pid=16656, effective(0, 0), real(0, 0)] ../source3/lib/events.c:437(smbd_idle_event_handler)
smbd_idle_event_handler: idle_evt(deadtime) (nil) rescheduled
[2016/01/25 11:54:54.325390, 10, pid=16656, effective(0, 0), real(0, 0)] ../source3/lib/events.c:426(smbd_idle_event_handler)
smbd_idle_event_handler: idle_evt(housekeeping) (nil) called
[2016/01/25 11:54:54.325426, 5, pid=16656, effective(0, 0), real(0, 0)] ../source3/smbd/process.c:2742(housekeeping_fn)
housekeeping
[2016/01/25 11:54:54.325462, 4, pid=16656, effective(0, 0), real(0, 0)] ../source3/smbd/sec_ctx.c:316(set_sec_ctx)
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2016/01/25 11:54:54.325496, 5, pid=16656, effective(0, 0), real(0, 0)] ../libcli/security/security_token.c:53(security_token_debug)
Security token: (NULL)
[2016/01/25 11:54:54.325530, 5, pid=16656, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:629(debug_unix_user_token)
UNIX token of user 0
Primary group is 0 and contains 0 supplementary groups
[2016/01/25 11:54:54.325590, 5, pid=16656, effective(0, 0), real(0, 0)] ../source3/smbd/uid.c:425(smbd_change_to_root_user)
change_to_root_user: now uid=(0,0) gid=(0,0)
[2016/01/25 11:54:54.325629, 10, pid=16656, effective(0, 0), real(0, 0)] ../source3/lib/events.c:437(smbd_idle_event_handler)
smbd_idle_event_handler: idle_evt(housekeeping) (nil) rescheduled
[2016/01/25 11:55:30.194201, 2, pid=32028, effective(0, 0), real(0, 0)] ../source3/smbd/server.c:420(remove_child_pid)
Could not find child 18176 -- ignoring
To check the status of the debug:
smbcontrol smbd debuglevel
Debug set to 0:
[root@P-DXi6902 ~]# smbcontrol smbd debuglevel
PID 32028: all:0 tdb:0 printdrivers:0 lanman:0 smb:0 rpc_parse:0 rpc_srv:0 rpc_cli:0 passdb:0 sam:0 auth:0 winbind:0 vfs:0
idmap:0 quota:0 acls:0 locking:0 msdfs:0 dmapi:0 registry:0 scavenger:0 dns:0 ldb:0
Debug set to 10:
[root@P-DXi6902 samba]# smbcontrol smbd debuglevel
PID 32028: all:10 tdb:10 printdrivers:10 lanman:10 smb:10 rpc_parse:10 rpc_srv:10 rpc_cli:10 passdb:10 sam:10 auth:10 winbind:10 vfs:10
idmap:10 quota:10 acls:10 locking:10 msdfs:10 dmapi:10 registry:10 scavenger:10 dns:10 ldb:10
[root@P-DXi6902 samba]#
Using smbcontrol to debug does not change smb.conf or smb.conf.extra files.
smbcontrol debug will NOT persist through a DXI reboot.
Debug levels for samba range from 0 – 10.
This page was generated by the BrainKeeper Enterprise Wiki, © 2018 |