PDA

View Full Version : Sharing a Printer with Samba


JonR
22nd August 2004, 08:32 PM
Hi guys.

I've installed an FC2 server for my LAN and am trying to share the printer connected to the server with XP clients on the LAN via Samba. File serving is working fine and I think I'm nearly there with serving the printer...
The printer is a Lexmark T520 which I have configured on the server as a generic postscript printer and which works fine printing direct from FC2.

Here's my smb.conf:

[global]
workgroup = MDKGROUP
netbios name = DIAKONOS
security = SHARE

[netfs]
comment = Network Filestore on DIAKONOS
path = /export
force user = netfs
force group = users
read only = No
guest ok = Yes

[printers]
comment = All Printers
path = /var/spool/samba
browsable = no
guest ok = no
writable = no
printable = yes

It's pretty basic because I've been trying to understand not just what to do to get Samba to work but what exactly each line in the config file does.

On my XP clients I see the server and the printer as \\Diakonos\T520PS and I've set up an XP queue on that address. I used the local XP printer driver for the T520 (PS) which I have loaded on the XP boxes since FC2 would not download a driver to the client. When I printed a test page from XP the printer spooled the postscript program for the test page.

So, I added this line to the smb.conf:

use client driver = yes

I printed a one line text file from XP with the contents: "my text file" and.... it printed!.. right in the middle of the page at about 144pt size, backwards and mirror image...

Any ideas? I get the feeling I'm close to fixing this but there's something I don't know...

JonR

jimbo
22nd August 2004, 08:58 PM
hmm... if the text file printed from XP properly then it could be some conflict between the print drivers on XP and the one on the FC2 machine.

Try setting the print queue up on the XP machine as just a RAW printer so it isn't applying any formatting on the XP side. That way it will just pass the raw data to the FC2 machine and let Cups format it.

On the reverse side you could setup a plain raw queue on the FC2 side and then use the drivers on the XP side to do the formatting. That is what I typically do if I have Windows machines printing to a printer attached to a Linux box. I just setup a generic raw print queue on Linux and let the Windows clients use their own print drivers.

Of course for that to work you would also want to setup a normal print queue on the FC2 machine if you plan on doing any printing directly.

Don't know if this is a solution to your problem, but it's worth a try.

JonR
22nd August 2004, 09:26 PM

After the first attempt when the printer spooled the postscript code it seemed clear that the XP client had wrapped postscript around the test page and then forwarded it to the samba printer share on the FC2 server which in turn passed it on to CUPS (I assume) which treated it as raw data and formatted the postscript as a print spool. I guessed that the solution to this might be to set "use client driver", assuming that this would tell CUPS not to attempt further formatting of the data prior to sending it to the printer.
The reversed image produced by the second attempt looks like a driver problem of some..?

I'm not aware that it is possible to set up a raw printer queue on an XP box. I could try it on the FC2 box but as you point out that will mess up local printing.

??

ghenry
23rd August 2004, 09:30 AM
This is a cups settings for raw printing. see the cupsd.conf

JonR
23rd August 2004, 09:34 AM
Sorry to be so dense but...

1. Should I remove the "use client driver = yes" line from smb.conf?
2. What do I do with cupsd.conf? Will it mess up local printing if I change it?

ghenry
23rd August 2004, 11:41 AM
[ghenry@database perl]$ less /etc/cups/mime.types
[ghenry@database perl]$ less /etc/cups/mime.convs


Look for raw and uncomment the right lines.

JonR
23rd August 2004, 02:32 PM
Thanks.

Will this mess up local printing if I set cups to "raw"?

ghenry
23rd August 2004, 04:54 PM
No, it shouldn't, but if it does. you know what you have changed.

jimbo
23rd August 2004, 05:09 PM
If it does mess up local printing the just create a 2nd print queue with the Linux drivers configured and point it to the same printer. Use that queue for local printing and the raw one for your Windows network clients.

You can have as many print queues pointing to the same printer that you want. I use this feature a lot. I have print queues setup for the same printer at different resolutions so that if I need to print an image or something at high definition I can just point it to the print queue set at that resolution without having to go into print settings at the time I print. I just keep the default print queue at a low resolution in order to save time and ink. Sorta like the following:

epson_low is a queue set to low resolution (360 dpi)
epson_med is set to medium resolution (720 dpi)
epson_high is set to high resolution (1440 dpi)
epson_max is set to the printer's max resolution (2880 dpi)

epson_raw is setup for any Windows network shared printers

By the way, I use the fedora print configuration tools which makes this all really easy.

JonR
23rd August 2004, 05:12 PM
Thanks guys, I'll give it a go and report back...