[Samba] Difficulty with Samba 2.2.8 and native CUPS PS drivers

Kurt Pfeifle kpfeifle at danka.de
Mon Mar 31 17:49:58 GMT 2003


David F. Severski davidski-samba at deadheaven.com wrote on Samba-Digest;

> Mon Mar 31 05:18:11 GMT 2003
> 
> 
> On Mon, Mar 31, 2003 at 12:36:08PM +0200, Kurt Pfeifle wrote:
>> can you please verify, that "cupsaddsmb -v [printername]" completes
>> successfully This means, you need to have the "smbclient" command
>> putting the files successfully to the "print$" share, and afterwards
>> read "success" meassages in the output: 2 for the "rpcclient addriver"
>> commands and 1 for the "rpcclient setdriver" command...
> 
> Kurt,
> 
> The cupsaddsmb command completes with no errors.  I have also previously 
> deleted the ntdrivers.tdb, ntprinters.tdb, and ntprinters.tdb files, stoped 
> and restarted samba, and repeated the cupssmbadd command with no change 
> in results.

How baaaaad -- you're seriously limiting my further options to troubleshoot
this problem.

No, seriously now: I would have suggested to delete the various printing
related *.tdb files next and start all over.

> Below is the output of cupsaddsmb, editted only to obscure the 
> password used, along with a listing of the CUPS drivers in the print$ 
> share:
> 
> File list
> ---------
> root at geoff:/usr/local/samba# ll -R printers/
> total 3
> drwxrwxr-x  3 root  wheel  512 Mar 30 06:29 ./
> drwx--x--x  6 root  wheel  512 Jan 12 11:24 ../
> drwxrwxr-x  3 root  wheel  512 Mar 31 05:10 W32X86/
> 
> printers/W32X86:
> total 3
> drwxrwxr-x  3 root  wheel  512 Mar 31 05:10 ./
> drwxrwxr-x  3 root  wheel  512 Mar 30 06:29 ../
> drwxrwxr-x  2 root  wheel  512 Mar 31 05:10 2/
> 
> printers/W32X86/2:
> total 648
> drwxrwxr-x  2 root  wheel     512 Mar 31 05:10 ./
> drwxrwxr-x  3 root  wheel     512 Mar 31 05:10 ../
> -rwxr--r--  1 root  wheel  120593 Mar 31 05:10 Canon_BJC.ppd*
> -rwxr--r--  1 root  wheel   14234 Mar 31 05:10 cups.hlp*
> -rwxr--r--  1 root  wheel  278380 Mar 31 05:10 cupsdrvr.dll*
> -rwxr--r--  1 root  wheel  215848 Mar 31 05:10 cupsui.dll*
> ---------
> 
> cupsaddsmb -v -a
> ----------------
> Running command: smbclient //localhost/print\$ -N -U'root%12345' -c 'mkdir W32X86;put /var/spool/cups/tmp/3e883e5be9b91 W32X86/Canon_BJC.ppd;put /usr/local/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll;put /usr/local/share/cups/drivers/cupsui.dll W32X86/cupsui.dll;put /usr/local/share/cups/drivers/cups.hlp W32X86/cups.hlp'
> added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0
> Domain=[DEADHEAVEN] OS=[Unix] Server=[Samba 2.2.8]
> NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
> putting file /var/spool/cups/tmp/3e883e5be9b91 as \W32X86/Canon_BJC.ppd (5353.0 kb/s) (average 5353.0 kb/s)
> putting file /usr/local/share/cups/drivers/cupsdrvr.dll as \W32X86/cupsdrvr.dll (4530.9 kb/s) (average 4751.5 kb/s)
> putting file /usr/local/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll (3399.8 kb/s) (average 4169.5 kb/s)
> putting file /usr/local/share/cups/drivers/cups.hlp as \W32X86/cups.hlp (397.2 kb/s) (average 3431.9 kb/s)
> 
> Running command: rpcclient localhost -N -U'root%12345' -c 'adddriver "Windows NT x86" "Canon_BJC:cupsdrvr.dll:Canon_BJC.ppd:cupsui.dll:cups.hlp:NULL:RAW:NULL"'
> cmd = adddriver "Windows NT x86" "Canon_BJC:cupsdrvr.dll:Canon_BJC.ppd:cupsui.dll:cups.hlp:NULL:RAW:NULL"
> Printer Driver Canon_BJC successfully installed.
> 
> Running command: rpcclient localhost -N -U'root%12345' -c 'setdriver Canon_BJC Canon_BJC'
> cmd = setdriver Canon_BJC Canon_BJC
> Succesfully set Canon_BJC to driver Canon_BJC.
> ----------------
> 
> Again, thanks for your help!
> 
> David

OK then -- lets troubleshoot a bit more...

First off: I have not yet tested 2.2.8 myself, so the following hints are
only a guideline of what I'd do to find out what's going on and what feils.

I don't remember if you posted your smb.conf already. Please do in your
next posting, should the problem persist (but strip the comments and empty
lines:

    grep -v "^#" /etc/samba/smb.conf | grep -v "^$" | grep -v "^;"

( Never mind -- I've found it now. But I leave this in for the benefit of other
readers -- it may avoid some traffic in the future... ;-)   But I can't see
a mention of your OS, and the source of your CUPS and Samba installations.
Self-compiled? Vendor-provided packages? )

And your "smbd" is linked against "libcups"? Check for

    "ldd `which smbd`| grep libcups"


1st step:
--------
Make sure you've a decent level of debuglevel enabled. Start with "3" (to
not get drowned in too much of output), and increase later should you need
it. Root can change the debuglevel "on the fly" with this command:

   "smbcontrol smbd debug 3"

Root can also check the current debuglevel:

   "smbcontrol smbd debuglevel"


2nd step:
---------
Open an xterm and watch the messages being written to the Samba smbd log
file as you proceed:

    "tail -f /var/log/samba/log.smbd"



3rd step:
---------
Check if Samba sees the printer and the driver:

    "rpcclient -U root%1234 localhost -c "enumprinters"
    "rpcclient -U root%1234 localhost -c "enumdrivers"

where "1234" is the password for root to access Samba (use "smbpasswd" to set
it up. Note, that "enumprinters" and "enumdrivers" may be made more verbose
by giving a level paramenter. "enumprinters" takes "0", "1" and "2".
"enumdrivers" takes "1", "2" and "3". Both default to "1". Please test if you
can get the highest level for "enumdrivers":

     "rpcclient -U root%1234 localhost -c "enumdrivers 3"

It should display the full paths of the driver files in "UNC notation", like
this example:

Printer Driver Info 3:
         Version: [2]
         Driver Name: [mopi]
         Architecture: [Windows NT x86]
         Driver Path: [\\10.160.50.23\print$\W32X86\2\cupsdrvr.dll]
         Datafile: [\\10.160.50.23\print$\W32X86\2\mopi.PPD]
         Configfile: [\\10.160.50.23\print$\W32X86\2\cupsui.dll]
         Helpfile: [\\10.160.50.23\print$\W32X86\2\cups.hlp]

         Dependentfiles: []
         Dependentfiles: [v]
         Dependentfiles: [X]

         Monitorname: []
         Defaultdatatype: [RAW]


4th step:
---------
If the second step fails to complete successfully, a real Windows
NT/2K/XP client will also have difficulties to download the drivers.
(OTOH, a failure here could also be due to a bug in Samba's rpcclient
implementation...  ;-)


5th step:
---------
 From your Win OS client, open the "Network Neighbourhood", browse to
the Samba server, open the "Printers" folder there, right-click on your
printer and select "Connect..." (or "Install..." or whatever it reads
in an English version of your Win OS).


Other ideas:
------------
* Verify that it still works with the Adobe printer driver files....
* Verify that you have the same CUPS driver files as I do


Kurt [ will try to install Samba 2.2.8 tonight so we talk from the
        same basis...]


P.S.: Sorry -- I re-read your first postiong, and I think I missed
       something there. You write that you *do* have the driver files
       on the WinXP in the "C:\WINDOWS\System32\spool\DRIVERS\W32X86\2\"
       directory. By which procedure did you bring this about?

       Furtheron, you say you had "the Adobe driver was removed, then
       reconnecting to my Samba printer, I connect fine but "... -- How
       did you bring this "reconnection" about?

       My suggested procedure above (5th step) will do both things at
       once:
          -- transfer and setup the driver files, and
          -- create the printer and the print path.

       Please try this now: delete the printer in your WinXP client's
       local "Printers" folder, browse to the Samba server's "Printers"
       folder via "Network Neighbourhood" and install the printer by
       right-clicking and selectiong "Connect..."

       I've never seen this failing in such a way that you have the
       driver files transferred successfully to the "...\W32X86\2\"
       directory, but can't print... The sort of failures I've seen are

         --a  "cupsaddsmb" not completing successfully, or/and
         --b  the method I described for downloading/installing driver/printer
              failing with an error message.

       I've not seen someone attempting to "reconnect" a printer that had
       the Adobe driver files installed previously....



More information about the samba mailing list