I've compiled Samba 3.0.0 with CUPS support. I verified this:
# ldd /usr/local/samba/sbin/smbd
*snip*
libcups.so.2 => /usr/lib/libcups.so.2 (0x400dc000)
*snip*
My smb.conf was copied from the HOWTO and the relevant sections look
like:
[global]
*snip*
# print support
load printers = yes
printing = cups
printcap name = cups
*snip*
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root, @ntadmins
I log into the domain on an XP Pro client using the root account, and if
I try to browse to the printer via My Computer --> My Network Places -->
Entire Network --> MyDomain --> ds119b (this is my samba server) -->
Printers and Faxes, it comes up blank. If I try to directly access the
printer via \\ds119b\MyPrinterName, it gets stuck in a loop. In both
cases, I am getting errors like this:
Dec 9 13:38:17 ds119b smbd[21244]: [2003/12/09 13:38:17,
0] printing/pcap.c:pcap_printername_ok(282)
Dec 9 13:38:17 ds119b smbd[21244]: Unable to open printcap file cups
for read!
Any ideas? Thanks!
-Fran
--
To unsubscribe from this list go to the following URL and read the
instructions: http://lists.samba.org/mailman/listinfo/samba
# smbclient //ds119b/ps4
Password:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
#
The syslog shows this as a result:
Dec 9 13:46:47 ds119b smbd[21284]: [2003/12/09 13:46:47,
0] printing/pcap.c:pcap_printername_ok(282)
Dec 9 13:46:47 ds119b smbd[21284]: Unable to open printcap file cups
for read!
Dec 9 13:46:47 ds119b smbd[21284]: [2003/12/09 13:46:47, 0]
smbd/service.c:make_connection(850)
Dec 9 13:46:47 ds119b smbd[21284]: ds119b (192.168.2.232) couldn't
find service ps4
I can successfully print to this printer from the samba linux host via
the standard lpr -Pps4 approach. I checked my cupsd.conf to make sure
it had a Printcap = /etc/printcap and PrintcapFormat = BSD entries and
it does. The generated /etc/printcap has only one non-comment line,
"ps4:".
-Fran
It means Samba doesn't know about a printer share named "ps4"
(nor a file share of that name)....
> The syslog shows this as a result:
>
> Dec 9 13:46:47 ds119b smbd[21284]: [2003/12/09 13:46:47,
> 0] printing/pcap.c:pcap_printername_ok(282)
> Dec 9 13:46:47 ds119b smbd[21284]: Unable to open printcap file cups
> for read!
This message might be bogus in your context and not lead to
your real problem...
> Dec 9 13:46:47 ds119b smbd[21284]: [2003/12/09 13:46:47, 0]
> smbd/service.c:make_connection(850)
> Dec 9 13:46:47 ds119b smbd[21284]: ds119b (192.168.2.232) couldn't
> find service ps4
>
See?
> I can successfully print to this printer from the samba linux host via
> the standard lpr -Pps4 approach. I checked my cupsd.conf to make sure
> it had a Printcap = /etc/printcap and PrintcapFormat = BSD entries and
> it does.
Have you also checked your smb.conf for an entry of
"load printers = yes"
??
> The generated /etc/printcap has only one non-comment line,
> "ps4:".
>
That's OK.
I forgot: should you have created the "ps4" printer
while smbd was already running, Samba might not yet
know about the printer (Samba bug -- it *should* update
its list of available printer shares just like it does
with file shares....).
Sending a "kill -HUP `pidof smbd`" might help. Or restart
smbd.
You mention that it complains that it can't find the share - I think it
makes perfect sense that Samba complains that it doesn't know about a
share called 'ps4' right after it complained that it couldn't open the
CUPS configuration. :-) It stands to reason that it doesn't know it
exists because it can't read the config. I'm more asking about the root
problem of why it is complaining that it was "Unable to open printcap
file cups for read!".
Thanks for the reply - it looks like I've covered all of the gotchas
that you mentioned. Something else seems to be at work here...
-Fran
Hopefully a dumb question... but is cups running? Also, what does an
lpstat -a show?
~ Daniel
-----------------------------------------------------------------------
This message is the property of Time Inc. or its affiliates. It may be
legally privileged and/or confidential and is intended only for the use
of the addressee(s). No addressee should forward, print, copy, or
otherwise reproduce this message in any manner that would allow it to be
viewed by any individual not originally listed as a recipient. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorized disclosure, dissemination, distribution,
copying or the taking of any action in reliance on the information
herein is strictly prohibited. If you have received this communication
in error, please immediately notify the sender and delete this message.
Thank you.
> Hopefully a dumb question... but is cups running? Also, what does an
> lpstat -a show?
"Dumb" questions are usually the right kind to be asking, it's bound to
be something basic that I missed. :-) However, everything looks ok:
# ps -eaf | grep cupsd
root 21413 1 0 14:04 ? 00:00:00 cupsd
# lpstat -a
ps4 accepting requests since Jan 01 00:00
I do find the "Jan 01" date a bit odd, but printing is functioning
normally from outside of samba on this host.
Thanks,
Fran
> I've restarted the daemons many times since altering my smb.conf. My
> smb.conf definitely has "load printers = yes" (see the smb.conf excerpt
> I sent in my initial post
Sorry, hadn't seen it....
> for the rest of the relevant configuration
> entries).
>
So I *did* read now what *you* wrote into smb.conf.
But... is Samba reading the same thing?
Use "testparm -v > smb-conf-as-seen-by-samba.txt" (hit ENTER twice)
and then investigate "smb-conf-as-seen-by-samba.txt".
> You mention that it complains that it can't find the share - I think it
> makes perfect sense that Samba complains that it doesn't know about a
> share called 'ps4' right after it complained that it couldn't open the
> CUPS configuration. :-)
It complained about this: "Unable to open printcap file cups for read!"
This means that *your* Samba tries to look for a printcap file with
the *name* "cups" to read.
However, if smbd is compiled against libcups, *and* if "printing = cups"
and "printcap = cups" smbd doesn't really need a printcap file and it
wouldn't look for one with that name either (It just means that it should
rely on the CUPS-API to find out available printers).... Unless you
found a real bug, that is!
I have set "Printcap /dev/null" in cupsd.conf and re-started cupsd first
then smbd. Guess what? "smbclient -L localhost" still lists all my
printers! And I can still print from my Windows apps. (I can't print
anymore from OpenOffice, since that one *does* look for a printcap....)
> It stands to reason that it doesn't know it
> exists because it can't read the config.
What are the access rights on that printcap file, anyway?
> I'm more asking about the root
> problem of why it is complaining that it was "Unable to open printcap
> file cups for read!".
>
Maybe you are not running the smbd you think you are? Maybe
you compiled yourself, and are still starting the previous
smbd in a different path (not having libcups support compiled
in?)
What is "which smbd" giving you?
> Thanks for the reply - it looks like I've covered all of the gotchas
> that you mentioned. Something else seems to be at work here...
>
It's strange, true. That's why I come up with strange ideas.....
'testparm -v' shows that samba is seeing (trimmed to the relevant
entries):
[global]
load printers = yes
printers = cups
printcap name = cups
[printers]
comment = All Printers
path = /var/spool/samba
printer admin = root, @ntadmins
guest ok = Yes
printable = Yes
browseable = No
> This means that *your* Samba tries to look for a printcap file with
> the *name* "cups" to read.
Yes, I thought that was odd - but I wasn't sure if that was just samba's
generic way of saying that it couldn't initialize the CUPS printers.
There is no printcap file named 'cups'. As you say, it shouldn't be
looking for one at all given that I've set printers = cups. I guess the
most accurate description of the problem is to say samba isn't seeing
"printers = cups" as the magic that it signifies, it just sees it as the
name of a plain old printcap file.
So my logic said to check that cups support was compiled in, and
'ldd /usr/local/samba/sbin/smbd' confirms that it is. That's when I
decided to post - I was fresh out of ideas. :-)
> Maybe you are not running the smbd you think you are? Maybe
> you compiled yourself, and are still starting the previous
> smbd in a different path (not having libcups support compiled
> in?)
I removed the RedHat samba RPMs before compiling my own version. `which
smbd` doesn't find any smbd. I start it with the full path to
/usr/local/samba/sbin/smbd in my init.d file for smb.
I'll keep tinkering with it.
In desperation I tried "printcap = /etc/printcap" even though the HOWTO
recommended "printcap = cups" and Kurt's advice above is that you could
even redirect to /dev/null. Guess what, it worked. At least on my
install, it seems to require that you do have a real, live printcap even
for CUPS printing support. I then added another printer via the redhat
printer config tool, which added it to CUPS. I restarted smb and the
new printer showed up on my Windows clients. So, the residual question
is why does it require a real printcap file even under CUPS support?
The docs don't seem to feel that it should.
Now I need to solve the "You do not have sufficient access to your
computer to connect to this printer" problem from the Windows clients.
:-)
Thanks for the help,
>>I have set "Printcap /dev/null" in cupsd.conf and re-started cupsd first
>>then smbd. Guess what? "smbclient -L localhost" still lists all my
>>printers! And I can still print from my Windows apps. (I can't print
>>anymore from OpenOffice, since that one *does* look for a printcap....)
>
>
> In desperation I tried "printcap = /etc/printcap" even though the HOWTO
> recommended "printcap = cups" and Kurt's advice above is that you could
> even redirect to /dev/null. Guess what, it worked. At least on my
> install, it seems to require that you do have a real, live printcap even
> for CUPS printing support. I then added another printer via the redhat
> printer config tool, which added it to CUPS. I restarted smb and the
> new printer showed up on my Windows clients. So, the residual question
> is why does it require a real printcap file even under CUPS support?
I think you should submit a bug report to http://bugzilla.samba.org/
On Wed, 10 Dec 2003, Kurt Pfeifle wrote:
> Fran Fabrizio wrote:
>
> >>I have set "Printcap /dev/null" in cupsd.conf and re-started cupsd
> >>first then smbd. Guess what? "smbclient -L localhost" still lists all
> >>my printers! And I can still print from my Windows apps. (I can't
> >>print anymore from OpenOffice, since that one *does* look for a
> >>printcap....)
> >
> >
> > In desperation I tried "printcap = /etc/printcap" even though the
> > HOWTO recommended "printcap = cups" and Kurt's advice above is that
> > you could even redirect to /dev/null. Guess what, it worked. At
> > least on my install, it seems to require that you do have a real, live
> > printcap even for CUPS printing support. I then added another printer
> > via the redhat printer config tool, which added it to CUPS. I
> > restarted smb and the new printer showed up on my Windows clients.
> > So, the residual question is why does it require a real printcap file
> > even under CUPS support?
>
> I think you should submit a bug report to http://bugzilla.samba.org/
CUPS works fine for me here. No dummy printcap needed. Something
else is funny with that configuration.
- --
cheers, jerry
----------------------------------------------------------------------
Hewlett-Packard ------------------------- http://www.hp.com
SAMBA Team ---------------------- http://www.samba.org
GnuPG Key ---- http://www.plainjoe.org/gpg_public.asc
"If we're adding to the noise, turn off this song" --Switchfoot (2003)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/
iD8DBQE/1qm8IR7qMdg1EfYRAqvMAKCZHBM3g2L/elwWBqwUw6Z2eHe91ACgg6QL
EubTIqxIz/mBMY4POHUXa0Q=
=hLDc
-----END PGP SIGNATURE-----
> CUPS works fine for me here. No dummy printcap needed. Something
> else is funny with that configuration.
What version of CUPS? I have the following RPMs:
cups-devel-1.1.17-13.3.0.3
cups-1.1.17-13.3.0.3
cups-libs-1.1.17-13.3.0.3
Samba 3.0.0 built from source, all standard config settings, on Redhat
9.
My entire smb.conf (mostly based off of the samples in the O'Reilly
book):
[global]
netbios name = ds119b
workgroup = CISSAMBADOMAIN
wins support = yes
encrypt passwords = yes
domain master = yes
local master = yes
preferred master = yes
os level = 65
security = user
domain logons = yes
; roaming profile support
logon path = \\%L\profiles\%u\%m
logon script = logon.bat
logon drive = H:
logon home = \\%L\%u\.win_profile\%m
time server = yes
; script for adding users
add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false
-M %u
add machine script = /usr/sbin/useradd -d /dev/null -g 100 -s
/bin/false -M %u
# print support
printing = cups
printcap name = /etc/printcap
load printers = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
public = yes
guest ok = yes
writable = no
printable = yes
printer admin = root, @ntadmins
[netlogon]
path = /usr/local/samba/lib/netlogon
writable = no
browsable = no
write list = root fran
[profiles]
path = /home/samba-ntprof
browsable = no
writable = yes
create mask = 0600
directory mask = 0700
[homes]
read only = no
browsable = no
guest ok = no
map archive = yes
--
Carsten Buechner
EDAG-Wolfsburg | Phone: +49-05361-799181
Schweriner Str. 4 | FAX: +49-05361-799134
38444 Wolfsburg | eMail: cb3...@edag.de