Fix for disappearing printer in Samba 3.x

I've been using Samba for awhile to allow (among other things) my Windows boxes to print to my CUPS-based printer on Gentoo Linux. Haven't had any problems in a good long while (not since getting it set up initially, 4-5 years ago). Until this week, when portage updated my Samba.

It appears the problem was that it upgraded from 2.x to 3.x. But, it might also be that the CUPS auto-detection stopped working. In any case, only local (CUPS-based) printing was working, Samba print jobs were getting "service is unavailable" errors in the Samba logs. In addition, smbclient -L was no longer showing the printer share.

As it turns out, Samba comes with a utility called "testparm" (the sample syntax I found was to invoke it as "testparm -s -v") that can be used to diagnose configuration errors. I discovered this quite by accident, in the "Enabling Anonymous Printing" section of the Samba SimplePrintServer HOWTO. Lo and behold, it issued a warning (apparently, not loading your defined share is just a warning) about missing a path= setting for my printer, along with "NOTE: Service HPPSC2210xi is flagged unavailable." Finally, some diagnostics!

Adding a path entry (odd, never needed that before) and I'm back in business. Grumbling a bit about why Samba wasn't a little more informative about the nature of the problem (I looked in the logs for configuration warnings once I noticed it wasn't recognizing the printer share, but found none). But at least it works.

In conclusion, if you're having Samba woes, testparm -s -v may be your friend.