The problem

 
Lately, I stumbled upon a minor but annoying issue with Samba on one of my file servers. There are no printers installed on this server, and probably never will be. However, smbd complains to no end in the client logfiles about not being able to connect to a CUPS server:
 

[david@Samba ~]$ head /var/log/samba.dfpc5
...
[2013/07/23 07:49:24.869727,  0] printing/print_cups.c:109(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2013/07/23 07:49:24.869790,  0] printing/print_cups.c:468(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
...

 
All of the client logfiles were spammed continously by Samba with these lines. While this did not seem to harm the performance of the server, I wanted to ged rid of them. After all, I never configured this Samba server to use CUPS, so why the hell is it trying to find one ?
 

The cause

 
This file server runs Slackware Linux, and the Samba package provided by Slackware, is compiled with – – enable-cups (like it is on most distros). Consequently, unless you tell it otherwise, Samba uses CUPS as the default printing system and tries to connect to a local CUPS server. And if fails to do so, it starts spamming your log files . . .

 

The solution

 

There are several solutions to this problem:

  • reconfigure your Samba installation not to use CUPS
  • recompile the Samba package without CUPS support
  • run CUPS anyway on that server so Samba can connect to it

 
I prefer the 1st solution. Just edit your smb.conf file, and look for the line that says “printing = cups”. Pay attention to the ; character at the front, which actually commnents out this line. You must remove the ; character.

 

;   printing = cups

 printing = bsd

 
Save the file and restart the Samba service. Those pesky CUPS lines in your logfiles should be history.