My server is up and running for quite some time now – but still, I have no way of printing when my client is running Windows. It is time to integrate CUPS and Samba.
So, we start off with the official Gentoo Samba documentation; here are the sections out of /etc/samba/smb.conf:
# This is the print drivers information section
[print$]
comment = Printer Drivers
path = /etc/samba/printer
guest ok = no
browseable = yes
read only = yes
# Print admins
write list = thomas,root
# a "printer share"
[Deskjet970]
comment = HP Deskjet 970Cxi printer
printable = yes
path = /var/spool/samba
public = yes
guest ok = no
# Printer admins
printer admin = thomas,root
# printers share
[printers]
comment = All printers
path = /var/spool/samba
browseable = no
guest ok = no
public = yes
writable = no
printable = yes
create mode = 0700
# who can admin the printer?
printer admin = thomas,root
print command = lpr-cups -P %p -o raw %s -r
Then, I created the directory /etc/samba/printer and altered /etc/nsswitch.conf as given in the howto.
Also, /etc/cups/cupsd.conf was lacking a “ServerName” entry. I set it to
ServerName server
So, it’s in line with the general naming convention.
Next step is to emerge cups-windows for the CUPS windows printer driver. Also, we need the files ps5ui.dll, pscript.hlp, pscript.ntf and pscript5.dll from a Windows install (I had to do a lot of search on this, and finally found it in the Gentoo forums).
Then, we restart cups, and use cupsaddsmb as follows:
cupsaddsmb -U root -v Deskjet970
(note: It took me a long time, but for this to work, the following lines have to be commented out in /etc/samba/smb.conf):
disable spoolss = yes
show add printer wizard = no
use client driver = yes
invalid users = root
Note that with the exception of the last one, these all need to remain commented out.
Now, for the test on the windows client – when connecting to the printer, the driver installs automatically and – everything works! Horray!
For completeness’ sake, I have put my full /etc/cups/cupsd.conf and /etc/samba/smb.conf on the “techie” page.