[Samba] Rpcclient - setdriver.

Kurt Pfeifle kpfeifle at danka.de
Thu May 8 11:17:45 GMT 2003


Lars Göransson larg at spray.se wrote on Samba-Digest

> Mon May 5 17:08:58 GMT 2003
> 
> 
> I have done one succesful driver for downloading to my windows 2000-client. 
> When i try set another with "setdriver " I get a result as : SetPrinter call failed!

The setdriver call expects these preconditions:

*  That the driver *files* are present (in [print$]/W32X86/2/ for the WinNT/2k/XP
    and in [print$]/WIN40/0/ for the Win95/98/ME architectures). Check for presence
    of files with the "ls" (shell) command.

*  That the driver is "registered" with Samba (this is done by an "adddriver"
    command which must run successfully and which writes the driver info into the
    Samba *.tdb files). (BTW, you are free to choose any driver name whe you run
    the adddriver command -- exluding  length and some other restrictions -- for
    the driver. CUPS per default uses the same  name as the printer). Check for
    "registration" with the "enumdrivers" (rpcclient) command.

*  That a printqueue with the specified name is present *and* registered in the
    *.tdb files of Samba. Check with the "enumprinters" (rpcclient) command.

*  That your connection credentials are those of a "printer admin" (as specified
    in smbd.conf), or root. Check the used credentials with the logfiles or with
    the "smbstatus" or "watch -n2 --differences=cumulative smbstatus" commands.

> The only differens between them is in the desritption-field
> 
>        flags:[0x800000]
>        name:[\\localhost\HP4600]
>        description:[\\localhost\HP4600,HP4600,H4600]
>        comment:[H4600]

This one (printername HP4600) has had a successfull "setdriver" command executed,
and has a driver with the same name (this is what CUPS' "cupsaddsmb" does by
default: using the same name for printer and driver).

Note that the "drivername" and the "printername" don't *need* to be the same.

>        flags:[0x800000]
>        name:[\\localhost\HP4600CLJ]
>        description:[\\localhost\HP4600CLJ,,HP4600CLJ]
>        comment:[HP4600CLJ]

This one (printername HP4600CLJ) has no driver set. This one could be set to the
same driver as the printer "HP4600" by

    rpcclient -U'root%password' -c 'setdriver printername drivername' SAMBA-SERVER-NAME

which maps to

    rpcclient -U'root%xxxxxxxx' -c 'setdriver HP4600CLJ HP4600' SAMBA-SERVER-NAME

The real question then is: does the driver with the name "HP4600" work
well with the printer "HP4600CLJ" ? But that is another question, outside the
scope of *this* discussion.

If you need to use a new driver for the HP4600CLJ printer, and if you want to
do it manually, you need to follow these steps in the given order:

  * upload the driver files into [print$]/W32X86/ (NOTE: *not* into the "2"
    subdir!) and into [print$]/WIN40/ (NOTE: *not* into the "0" subdir!), using
    any means ("cp", "scp", "ftp" -- but "smbclient" is probably the best...).

  * register the files as drivers with 1 or 2 "adddriver" commands (one for each
    architecture you want to support). (MOTE: you can't normally run the adddriver
    a second time, because the first run has "consumed" the driver files from the
    place they were and moved them to the "2" resp. "0" subdirectories.

  * associate the new driver with the printer, using the "setdriver" command.

I think this is very well and in *great* *detail* explained in the new draft
of the printing chapter of the Samba HOWTO Collection 3.0. Certainly not
anywhere on the whole world (including all Samba books) is it explained in
more detail than there!

Note that the draft I am talking about is located currently here:

    +================================================================+
    |                                                                |
    |    http://www.linuxprinting.org/kpfeifle/SambaPrintHOWTO/      |
    |                                                                |
    +================================================================+

Note that the respective chapters in the *full* HOWTO Collection (as announced
by Jan Terpstra) still do include the "old" version. The new version needs to
be transformed into DocBook/XML first before they can be included into Jan's
complete work. This may take one or two more weeks.

The new printing descriptions may *still* be insufficient. But if it is, you
need to tell me:

  * What is it that you don't  understand?
  * What is it that doesn't work for you?
  * What is it that could be explained in a more comprehensive way?

You need to follow the guidelines discribed there (even *twice*, once in the
chapter on "classical" printing, and once in the CUPS chapter). But I expect
(and I think this is a reasonable expectation) to receive detailed reports:
the same details about your failure  (with all commands you used) as are
included in my reported guide to set it up successfully.

Don't expect any answer to privat mails which just say "It doesn't work for
me." with no more details (you know who you are....)  My crystal ball is
defunct currently. (This is not meant to target anyone in this thread peronally.
Specifically not you, Lars!  Just a general reminder of what *I* need to
improve the docu...   ;-)

Cheers,
Kurt


> How can I put in HP4600CLJ in between ",," in description:[\\localhost\HP4600CLJ,,HP4600CLJ]
> In Windows It is shown as "Model", If that is the solution, dont think so..or?
> 
> I can't understand why there is a difference between this printer as shown with enumprinters, the printcap entrys are similar.





More information about the samba mailing list