[Samba] Printing problem
Joel Hammer
Joel at HammersHome.com
Thu Nov 28 14:41:02 GMT 2002
My comments may relate only to my printing software, lprng.
That printing share looks mighty suspect. [printers] is a special
share name. I forget what it does exactly, but it lets you load all
your printers in /etc/printcap with just one share definition, or some
such (better read about THAT.) You need to have a share just for your
printer just for windows clients. Here is what one of mine looks like:
[lp]
comment = Raw Printer for Z53
# max print jobs = 1
path = /tmp
create mask = 0700
guest ok = yes
hosts allow = 192.168.
printable = Yes
printing = lprng
# print command = echo "Tried to print %s" > /SPOOL/junk.%s
print command = echo %J %p %s >> /tmp/junkJ;\
a="`echo '%J' | sed "s/^.*- //"`" ;\
echo This is truncated $a >> /tmp/junkJ;\
/usr/bin/lpr -Plp -J"$a" %s;\
rm %s
lpq command = /usr/bin/lpq -Plp
lprm command = /usr/bin/lprm -Plp %j
lppause command = /usr/sbin/lpc hold -Plp %j
lpresume command = /usr/sbin/lpc release -Plp %j
printer name = lp
share modes = No
I don't load the drivers from my server. This printer (lp) definition will not
be the same as the one used for local printing because this printer queue
(lp, as invoked with the lpr command) has no print filter referenced in
/etc/printcap, since windows filters its own jobs.
Printing with samba is simple if you keep just two things in mind.
1. The windows clients transfers the job to the spool directory specified in
the share.
2. samba invokes the print command to print that job.
Some other points to keep in mind:
%p and %s refer to the printer name and the job name, respectively.
%J refers to the banner page name, which defaults to the file name from
the windows client. This is very handy. You display the banner page name
in the printer queue with the -J parameter with the lpr command.
The other thing to know about is /etc/lpd.perms. If you suspect that is your
problem, and who wouldn't after trying to read the documentation for that
thing (if you ever want to write a GUI for a configuration file, consider
that one) just put one line into it:
DEFAULT ACCEPT
This will let any client manipulate the printing queue, which may be good,
bad, or indifferent, depending on your network setup.
One more trick. If you can't get the printer drivers for your printer
working right in windows, and this can be a problem, set up your printer
share to point to a printer queue which can handle postscript files, which
should be most printer queues in linux. Then, on the windows client side,
set up the printer with a generic postscript printer, HP laserjet III plus
or some such seems to work fine. This approach has solved all my printing
problems with windows clients.
Joel
On Thu, Nov 28, 2002 at 11:50:36AM +0700, Jean-Francois Pelletier wrote:
> Hi,
>
> First of all, thanks for all the replies that I got a couple of weeks
> ago about another question; it really helped me understanding the issue.
>
> Now I'm installing a printer on my Linux server (RH 7.3 with Samba
> 2.2.6); I can print from my Linux computer, and even see the printer
> from my XP computer, but I can't print from XP.
>
> Here's my smb.conf:
>
> [global]
> netbios name = Maggie
> security = share
> printing = bsd
> printcap name = /etc/printcap
> load printers = yes
> [public]
> path = /usr/public
> browseable = yes
> guest ok = yes
> read only = no
> [printers]
> comment = Brother HL-1650
> security = share
> path = /var/spool/lpd/Brother_HL-1650
> browseable = no
> public = yes
> guest ok = yes
> writable = no
> printable = yes
> use client driver = yes
>
>
> Like I said, from the Linux server, everything is OK and I can print.
> When I go to my XP computer, and I click "Add a printer", XP can find my
> printer by browsing the network, and the installation is without any
> glitches. I can see the printer properties but when I try to print the
> test page, I got an error message: "Test page failed to print.". If I
> try to print from WordPad, it says that it's printing for a fraction of
> a second, but then says also "Unable to print".
>
> Thanks in advance!
>
> Jean-Francois Pelletier
>
>
> --
> To unsubscribe from this list go to the following URL and read the
> instructions: http://lists.samba.org/mailman/listinfo/samba
More information about the samba
mailing list