Re: Printing from Samba



On Dec 10 2007, 6:51 pm, Doug Laidlaw <d...@xxxxxxxxxxxxxxxxx> wrote:
After my previous fight with the computers, I wrote:

Since I have reported this backwards,  I will terminate this thread here..
start the config again from the beginning, make a diary of what I have
tried, and give a proper Smart Questions post later, if I am stuck for more
than 24 hours.

So, here it is again:

My problem: I have a Brother printer which isn't on the CUPS list of
printers.  A driver in RPM format is available from Brother's Web site,
which works with Cups, but it is very slow compared to Windows printing.
KDE calls it defective, and I use KDE.

I am running Samba 1.3

The printer is connected via USB to my Mandriva system.  I want my wife's
laptop running XP to be able to print to it via Samba, since she has
nowhere to put a printer in her study, otherwise I might do the reverse.

Running cupsaddsmb, I initially got an error: "No Windows printer drivers
are installed!"

I then deleted Mandriva's "omnibus" smb.conf, and installed one with only
what I need.  At present, it is as follows:

 [global]
netbios name = The_Server
server string = Samba Server
workgroup = My_Windows_Work_group
security = user
encrypt passwords = yes
smb passwd file = /var/lib/samba/private/smbpasswd
log file = /var/log/samba/%m.log
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
wins support = yes
hostname lookups = yes
; hosts equiv = /etc/hosts
hosts allow = 192.168.1. 127.
hosts deny = All
interfaces = lo eth0
bind interfaces only = yes
guest ok = yes
browse list = yes
printcap name = cups
printing = cups
load printers = yes

 [home_directories]
comment = User's home directory
path = /home/%U
read only = no
valid users = %U root

 [printers]
comment = All Printers
browseable = no
printable = yes
writable = no
public = yes
guest ok = yes
path = /var/spool/samba
printer admin = root

# [M240C]
#comment = Brother Multifunction 240C
#printable = yes
#path = /var/spool/samba
#public = yes
#guest ok = yes
#printer admin = root

 [print$]
comment = Printer Drivers
path = /etc/samba/drivers
browseable = yes
guest ok = no
read only = yes
write list = root

With it, I can browse my Home directories.  

To create the Windows files in C:\...\w32X86\3\, I followed the procedure in
the Gentoo Samba HOWTO, and installed a Postscript printer.  I then copied
the files across to /usr/share/cups/drivers.  The RPM for CUPS6 has a bug,
in that it accepts only Cups 1.1 and 1.2, although it says ">".  This is
repeated in the one provided by Mandriva, but the tarball ran perfectly.  I
also put the .ppd file in the same directory.  My \3\ directory on XP has a
heap of other files, not mentioned in the HOWTO.  I copied them across as
well.

The output from cupsaddsmb is now:

"Running command:
smbclient ///var/run/cups/cups.sock/print$ -N -A /root/tmp/475df93dc0818 -c 'mkdir
W32X86;put /root/tmp/475df933a18e4
W32X86/BROTHERM240C.ppd;put /usr/share/cups/drivers/ps5ui.dll
W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp
W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf
W32X86/pscript.ntf;put /usr/share/cups/drivers/pscript5.dll
W32X86/pscript5.dll'
Connection to  failed

Unable to copy Windows 2000 printer driver files (1)!"

repeating indefinitely.  The command is all on one line.

I was told that this is a permissions problem, but my [print$] share looks
O.K.  All driver files are 664, owned by root.
There is a definition of who is the printer admin in your /etc/samba/
smb.conf file.The directive might look something like this

printer admin = smbprint

where smbprint is a valid user on your system. When the cupsaddsmb
command attempts to copy the file, it first pretends to be a windows
smb client. It connects as the user you specify on the cupsaddsmb
command line, which must be a valid user in the samba passwd file,
presumably smbprint.

Root probably isn't allowed to connect to your samba server.

Define a user in both samb and on your system with the same name,
designate that user as the printer admin in the smb.conf file and then
pass that name in on the cupsaddsmb command line.

you should also be able to connect from a windows box to samba-server/
print$ as the print admin and write files.






For Ubuntu, which doesn't have a root user, there was a suggestion to put an
ordinary user in the cupsaddsmb command line, but I should not need that.

I seem to recall that in the end I was told to ditch the whole idea and do
it differently - perhaps let the client use its own drivers?  I can't find
that thread now.

I have added the Samba server to my /etc/hosts, but haven't given my computer
a fixed IP address.  It is always 192.168.1.2.

Any suggestions appreciated.

Doug.

.



Relevant Pages