[Samba] Cups printers troubles

Kurt Pfeifle kpfeifle at danka.de
Wed Sep 11 16:49:01 GMT 2002


Matt Lung wrote on [samba-digest]:


 > Ok... here we go,
 >
 > I have a server running RH 7.3, samba 2.2.3a,

You *do* know, that there have been a *lot* of improvements and bugfixes
since 2.2.3a made by the Samba Team, especially related to printing, do
you?

Soon 2.2.6 will be out, again with a *lot* of bugfixes regarding printing...

 > and CUPS 1.1.14.  All the
 > printers we have are networked printers sitting off of Linksys
 > printservers.  On this server I am sharing all off our printers out via
 > Samba.  See my smb.conf file below.  This server works perfectly.  All
 > printers are shared out successfully.
 >
 > Primary CUPS server:
 > [global]
 >         workgroup = NEW
 >         security = DOMAIN
 >         server string = Samba Server v.2.2.3a
 >         encrypt passwords = Yes
 >         log file = /var/log/samba/log
 >         max log size = 0
 >         socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
 >         printcap name = cups
 >         os level = 30
 >         printing = cups
 >         load printers = yes
 >         print command = lpr-cups -P %p -o raw %s
 >         lpq command = lpstat -o %p
 >         lprm command = cancel %p-%j

These last 3 commands -- while not harmful in any way -- don't do
*anything* good either when you have set "printcap name = cups" and
"printing = cups" (recommended), if Samba is linked against libcups
(the default). In this case Samba knows how to print, remove and
query jobs by itself; it uses direct CUPS API functions to do
everything.

And, BTW, the 3 commands appear again in the [printers] section(quoted
below)... (shouldn't be harmful though).

 > [printers]
 >         comment = All Printers
 >         path = /var/spool/samba
 >         browseable = no
 >         public = yes
 >         guest ok = yes

"guest ok = yes" is a synonym t "public = yes".

 >         writable = no
 >         printable = yes
 >         print command = lpr-cups -P %p -o raw %s
 >         lpq command = lpstat -o %p
 >         lprm command = cancel %p-%j
 >         printer admin = @ntadm,root
 >
 >
 > Then... I have another server I want to configure as my CUPS backup
 > printing server.  This PC is running RH 7.2, samba 2.2.3a, and CUPS
 > 1.1.14.  I've installed all printers exactly the same as on the primary
 > CUPS server.  The problem I am haiving is that samba is having trouble
 > sharing out my printers right.  What I see in Network Neighborhood under
 > this PC is my two shares, and they are ok, then my printers which are
 > not ok.  My printers have the names like "}", "DAEMON = cupsd", "else",
 > and "fi".  Like it is reading code instead of my acual printer names.

This is really strange and I have never seen this reported.

Are you sure you are running the same binaries on the two systems?

Are both Samba programs linked against libcups? Verify by running
"ldd `which smbd` and see if it shows up libcups....

 > This is really perplexing because I have the same smb.conf setup for
 > this server as the primary CUPS server that is working.  See below...
 >
 > Secondary CUPS server:
 > [global]
 >         workgroup = NEW
 >         server string = Samba Server v.2.2.3a
 >         security = DOMAIN
 >         encrypt passwords = Yes
 >         log file = /var/log/samba/log
 >         max log size = 0
 >         socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
 >         printcap name = cups
 >         os level = 30
 >         printing = cups
 >         load printers = yes

Comparing line-by-line what you've quoted above, the print command lines
are missing here (but as I said that shouldn't make *any* difference).

 > [printers]
 >         comment = All Printers
 >         path = /var/spool/samba
 >         printer admin = @ntadm,root
 >         guest ok = Yes
 >         printable = Yes
 >         print command = lpr-cups -P %p -o raw %s
 >         lpq command = lpstat -o %p
 >         lprm command = cancel %p-%j
 >         browseable = No

You don't have an explicit "writeable = no" setting here (but this
shouldn't make a difference). Also, you don't have the "public = Yes"
here (which is only a synonym for "guest ok = yes").

So much for your "same smb.conf setup". This leaves some doubt about
your level of understanding about what you are doing and talking about
(no offense intended at all here!, newbies are always welcome; I just
don't want to talk to you about things you've long digested...).

It would help, if you'd make sure that

* either you qualify your statement, ensuring people reading it
   that you *do* know it is not the same line-by-line, but "in effect"

* or you do copy it line by line to make sure it *is* the
   same.

Verifying your two differently ordered smb.conf to be the same is
more difficult the way you presented it.

Did you test both servers with "testparm" and get no errors or
warnings?

Next point: while your smb.conf setup is largely the same on both
servers, *is your CUPS setup too?*

 > Something from the logs:
 > Sep 11 07:35:43 retainer smbd[1997]: [2002/09/11 07:35:43, 0]
 > printing/pcap.c:pcap_printername_ok(288)
 > Sep 11 07:35:43 retainer smbd[1997]:   Unable to open printcap file cups
 > for read!

Does the printcap exist at all? You can get CUPS to write a "dummy"
printcap by setting "Printcap /etc/printcap" in cupsd.conf....

If it exists, is it readable to the user smbd is running as?

 > - This is not a message i need to be seeing... how do i fix it?

Check my last two points first...

You may want to read http://www.cups.org/cups-help.html for some
other ideas about how to debug this.

 > Anyways..... if someone knows what the heck I am doing wrong please feel
 > free to let me know.
 >
 > Matt
 >






More information about the samba mailing list