Samba - Errors

mail

WARNING: The "syslog" option is deprecated

Situation

smbclient -L 12.34.56.78
	WARNING: The "syslog" option is deprecated
	Unable to initialize messaging context
	

Details

This can have 2 causes :
  1. /etc/samba/smb.conf actually has a clause like :
    logging = syslog
  2. A bug in smbclient itself. You can even reproduce it with :
    smbclient -L nothing.atThis.IP.address
    	WARNING: The "syslog" option is deprecated
    	Unable to initialize messaging context
    	WARNING: The "syslog" option is deprecated
    	do_connect: Connection to nothing.atThis.IP.address failed (Error NT_STATUS_HOST_UNREACHABLE)
    No fix/workaround so far

Solution

Fix the logging = syslog line of /etc/samba/smb.conf

  1. check the Samba configuration :
    testparm -sv 2>&1 | grep logging
    		logging = syslog
  2. edit /etc/samba/smb.conf to fix the logging directive :
    • quick'n'dirty : comment it out
    • logging = file : logs are stored in the file specified with log file = /path/to/file.log (details)
    • logging = systemd : explicit
  3. reload settings :
    systemctl restart smbd
mail

Failed to restart samba.service: Unit samba.service is masked.

Situation

systemctl restart samba
Failed to restart samba.service: Unit samba.service is masked.

Details

On Debianoids, the Samba service is not called samba but smbd (more precisely : /etc/systemd/system/multi-user.target.wants/smbd.service)

Solution

systemctl restart smbd