[Samba] cupsaddsmb -v, Warning: PPD file not found?!

Kurt Pfeifle kpfeifle at danka.de
Sat Mar 29 21:22:55 GMT 2003


> bwiese bwiese at cotse.com wrote on Samba-Digest:

> Sat Mar 29 14:40:38 GMT 2003
> 
> 
> Hello all,
> 
> I am running a Debian testing/unstable system with samba 2.2.3a-6 and
> cupsys 1.1.15-4 as a member server in a samba domain. 

Hi Brian,

these are rather old versions of CUPS and Samba. Both have seen a lot
of improvements since then -- especially regarding printer driver downloads
to Win clients. I'd suggest you upgrade to Samba-2.2.8 and CUPS-1.1.18 (or
1.1.19 which may be released soon).

> I have used CUPS to
> add a networked HP8100N printer and it works fine locally, but I'm having
> difficulty adding it to samba for Win98 domain clients to use.
> 
> I ran cupsaddsmb to add the printer and drivers to samba, but it cannot
> find the PPD file... where is it looking for this to be???
> 
> root at WS-072:/etc/samba/drivers# cupsaddsmb -a
> Warning: No PPD file for printer "HP8100N"!
> root at WS-072:/etc/samba/drivers# cupsaddsmb -v HP8100N
> Warning: No PPD file for printer "HP8100N"!
> 
> I have the "HP8100N.PPD" (generated by CUPS-o-matic) 

Oh dear! This is a PostScript printer!! Please -- never, ever use CUPS-O-Matic
PPDs with a PostScript printer! For PS printers use the PPD provided by the
vendor. For the HP8100N you can find it here:

    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/~checkout~/lpr/ppds/hp/HP_LaserJet_8100_Series.ppd?rev=1.1.1.1&content-type=text/plain

"CUPS-O-Matic" is now deprecated, even for non-PS printers. There is now
the new "PPD-O-Matic" online generator on the Linuxprinting.org website.
This one creates Adobe-spec compliant PPDs and doesn't require the cruel
Perl hacks inside the PPD. (It also requires the new "foomatic-rip"
ghostscript-wrapper script to be found here:

   http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0

> file placed in
> /usr/share/cups/drivers, /etc/cups/ppd, /etc/samba/drivers,
> /etc/samba/drivers/WIN40, /etc/samba/drivers/W32X86 ...

The PPD should be in "/etc/cups/ppd/" and have the same name as your printer.
(This is all taken care of by CUPS itself if you install the printer by one
of the suggested methods: web interface or commandline:

   "lpadmin -p hp8100n -v socket://[ip-address-of-hp8100]:9100 -E -P /path/to/downloaded/PPD"

Your printer should be better off than now, if set up by this   :)

> please help if you can, I have many more questions, but I'd like to first
> get past this minor one first... where is it looking for the PPD?

It is looking for the PPD in "/etc/cups/ppd/[printername].ppd". However, it is
not using file system commands to retrieve it, but it is using IPP calls (so
that it also works across the network).

I'll try to answer a few of your questions in advance, since I am writing up
some docu anyway just now. What follows is copy of the description about the
"cupsaddsmb" inner workings as I posted to the "kdeprint" mailing list a few
months ago:

###############################################################################


-------- Original Message --------
From: Kurt Pfeifle <kpfeifle at danka.de>
To: kde-print at mail.kde.org
Subject: Re: Understanding the export printer driver feature
Date: Sat, 25 Jan 2003 23:58:10 +0100

[....]

 >> OK, I've now got a copy of all the files in the list, but am having a slight
 >> problemw ith the export bit. In my case I'm running cups & samba on an old
 >> P150, and am running KDE on my laptop. Does KDEPrint require that the wizard
 >> and cups/samba servers be running on the same system? If not, where do I put
 >> the files on my laptop so that KDEPrint will find them to export them?
 >
 >
 >
 > I don't think CUPS server must be running,


No -- cupsd *must* be running too; but not necessarily on the same system. In
the case of the "KDE Export Driver Wizard" on the laptop, it only needs the
CUPS and Samba client parts of the programs installed. [I bet Michael knows
this, because his KDEPrint Wizards work....  ;-)  but his remarks might not
be understood fully because of their brevity...]

NOTE, that there could be not just 2, but 3 different hosts participating in
the execution of the command(s) [or even 4, if you count the printing Win
clients too]:

     * the one where "cupsaddsmb" is executed (which at least needs CUPS client
       commands and Samba client commands installed);

     * the CUPS server with the actual printer (and a Ghostscript or other CUPS
       driver) -- specified with "-h cupsservername" (CUPS server needs *not* Samba
       installed too);

     * the Samba server which offers the (PS-) Win driver for download from its
       [print$]-share  --  specified with "-H sambaservername" (*this* Samba server
       doesn't necessarily require a CUPS installation).

If you don't give "-h" or "-H" options it is assumed that everything concerns
localhost only.


 > but samba server should be
 > running


On the notebook you don't necessarily need a Samba *daemon* running...

 > as cupsaddsmb (and KDEPrint) uses smbclient and rpcclient
 > are used internally.


Before smbclient and rpcclient are doing their work, cupsaddsmb uses IPP
calls to retrieve the real PPD for the printer ("from /etc/cups/ppd/") from
the CUPS server. This part of the cupsaddsmb command is not visible from
the "-v" verbose output (see for an example what the output looks like at
http://de.samba.org/samba/docs/Samba-HOWTO-Collection.html#AEN1089 -- note that
it looks a bit different in more recent versions of CUPS and Samba.).

This is then copied to "/var/spool/cups/tmp/some-random-name" of the host
where the cupsaddsmb command runs, and used by smbclient to "put" it to the
intended Samba-Server's [print$]-share for download:

     smbclient //sambaservername/print\$ -N -U'root%secret' \
        -c 'mkdir W32X86;put /var/spool/cups/tmp/3cd1cc66376c0 W32X86/infotec_IS2027.PPD...

and later "rpcclient" enables and activates the drivers and initializes
the correct "device mode". (This stuff is required by the Windows clients;
basically it is s.th. which emulates what a MS Win NT print server would
retrieve from its registry when a Win client asks for it during driver
installation... [That's why a simple copying of the files to the
[print$]-share doesn't work. Samba stores this info in various *.tdb
files -- "ntdrivers.tdb", "ntprinters.tdb" and "printing.tdb"]):

     rpcclient sambaservername -N -U'root%secret' \
        -c 'adddriver "Windows NT x86" \
        "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'

     rpcclient localhost -N -U'root%secret' -c 'setdriver infotec_IS2027 infotec_IS2027'

At this stage all the files should be in the [print$]-share for download.
The clients "see" a shared printer on the Samba server with the driver
files possibly as "printername at cupsserver" (if the CUPS server had
"BrowseShortNames Off"). When they download the driver, the printer is
installed as "printername at cupsserver on sambaserver", where
"printername at cupsserver" is the name of the printer and "on sambaserver"
is automatically added. (This has been tested with Win 2K and XP
clients by me -- dunno about Win 9x/NT clients, where it might not work
at all or where the indicated printername might be different).

An actual print job would get spooled to the Samba server first (using
MS RPC printing calls), then transferred to the CUPS server (using the CUPS
API, because Samba is compiled against libcups), whereupon CUPS does the
rest of the job. (NOTE, that Samba doesn't need to be running on the
CUPS server because the primary Samba server is able to transfer the job
to the CUPS server using the CUPS API (with IPP).

I hope I didn't confuse you too much. (For me, it actually helped to
understand the whole network transparent mechanism better, once I thought
of the procedure taking place on three different hosts [or four, once
you counted the Win clients in]...).

                                                                                                           /
                                                                                           +-------------+//
                                                                                         --| printername |//
                                                                                         --|             |/
                                                                                           |             |
                                                                                           +-------------+
                                                                                                    |
                                                            CUPS server                             |
                                                       +-----------------------------------+--------|---------+
                                                       | cupsservername (has "printername" .        |         |
    localhost                                          |   installed)                      .        ^         |
+------------------------------------+      IPP       |                                   . /var/spool/cups/ |
| "cupsaddsmb                        |   ----------------> /etc/cups/ppd/printername.ppd  .              <-----+
|    -H sambaservername              |  /             |                v                  .                  | |
|    -h cupsservername               | /              +--------------- | -----------------+------------------+ |
|    -v                               /                                |                                       |
|    printername"  >-----------------´                                /                                        |
|                                    |                               /                                         |
|                                    |      IPP                     /                                          |
| /var/spool/cups/tmp/3cd1cc66376c0 <------------------------------´                                           |CUPS-API
|              v                     |                                                                         | (IPP)
|               \                    |                                                                         |
|                `----------------------------------------------.                                              |
|                /                   |      SMB                  \                                            /
|               /                    |                            \                                          /
| "smbclient >-´                     |                             \   Samba server                         /
|    //sambaservername/print\$       |               +------------- | --------------------+----------------/--+
|     [....] put ...3cd1cc66376c0"   |               |              v                     .               /   |
|                                    |               | sambaservername (stores PS driver  .              /    |
|                                    |               |   files plus printername.ppd       .             /     |
|                                    |               |   into its [print$] share....      .             |     |
|  "rpcclient [..] adddriver [..]"   |               |                                    .             ^     |
|  "rpcclient [..] setdriver [..]"   |               |                                    ./var/spool/samba/  |
|      v                             |               |                                    .                   |
|       \                            |               |                                    .             ^     |
|        \                           |               |                                    .             |     |
|         \                          |    MS-RPC     |   setting up and initializing      .              \    |
|          `-------------------------------------------> Samba*.tdb files                 .               \   |
|                                    |               |    (ntdrivers.tdb, printing.tdb    .                \  |
|                                    |               |     ntprinters.tdb...)             .                 \ |
+------------------------------------+               |                                    .                  \
                                                      |                                    .                   \
                                                      |                                    .                   |\
                                                      +------------------------------------+-------------------+ |
                                                                                                                 |
                                                                                                                 |
                                                                                                                 |MS-RPC
  NOTE: "sambaservername", "cupsservername"            +--------------------------------------------------+      |
        and "localhost" may actually be one            |                                                  |      |
        and the same PC (and in fact, in most          | Windows NT/2K/XP Client (wants to                |      |
        real-world scenarios they are...)              |   print to                                       |      |
                                                       |  "printername at cupsservername on sambaservername")|      |
                                                       |                                                  |      |
                                                       |                                  >----------------------+
                                                       |                                                  |
                                                       |                                                  |
                                                       +--------------------------------------------------+


Once a Win client downloads the driver from the Samba server and prints,
the CUPS server does *not* need a running Samba server  --  because Samba is
compiled against "libcups" it is a perfect CUPS IPP client and can transfer
the jobfile remotely (by using CUPS IPP functions) into the CUPS spool directory.



 > The location where to put the files is the
 > same as for cupsaddsmb, chech manual page.


IIRC, this also works with KDEPrint (long time since I tested this.). However,
it is a bit less comfortable than the commandline. While you can type in the
(remote) Samba server directly in the "Export driver..." dialog, you need
to specify the (remote) CUPS server by using the "Configure Manager" -->
"CUPS server" dialog first. (And BTW, this part of KDEPrint has working
"What's this?" quickhelps...)

 > Michael.


Cheers,
Kurt


###############################################################################


Now for your problem with the "printer has no PPD file message":

* check if it is there in "/etc/cups/ppd/[printername].ppd"

* if it is there, a smoke test if clients and client commands find it, may
   be "lpoptions -p printername -l"

* If you get an error message, even if the PPD is there (world readable),
   see if you have a (world-writeable) "tmp" subdir in "/var/spool/cups/"!
   [This subdir is used by cupsaddsmb to store the PPD before it uses
   "smbclient" to "put" it into the "[print$]" share. If it is missing
    you might see the error message you described...]

* Unfortunately I haven't tested this whole thing with Win98 clients yet.
   One caveat I can think of: Use printernames that are shorter than 8
   characters (or at a max are 8 chars + 3 chars suffix) -- otherwise the
   PPD name could be mangled (which could produce an error once you try
   to download the driver to the Win98 client -- but for this the cupsaddsmb
   needs to work right first, anyway....)

> peace
> Brian

Yes -- peace!
Kurt



More information about the samba mailing list