[Samba] Printer settings reset problems

Kurt Pfeifle kpfeifle at danka.de
Thu Feb 26 16:32:10 GMT 2004

> [Samba] Printer settings reset problems
> Anders Karlsson anders.karlsson at cendio.se
> Thu Feb 26 14:32:15 GMT 2004
> Hi,
> I am working on a print server project where we have ran into a big
> showstopper.

Which Operating System on the print server?
Which version of Samba?
Which version of CUPS?

> The print server works in a very mixed environment with
> clients running for example Linux, Windows NT4, Windows 2000, VMS,
> different Solaris versions and other Unix dialects. The server runs CUPS
> for printer spooling and Samba to serve the Windows machines. It's the
> Windows machines that has caused most problems and we now have problems
> with printer settings.
> When a Windows client adds a printer the drivers are downloaded as they
> should. This caused some problems earlier, but works fine now. After that
> the client gets printer settings from the server, for example
> available paper formats, toner saving modes, page orientations, stapling,
> and so on. These settings are made from Windows and are stored by Samba in
> the simulated registry files (tdb files) under /var/lib/samba/printers.
> Our problem is that these settings are reseted when done for another type
> of Windows.

You should be telling us which type of driver you have installed into
Samba and its [print$] share. As you know there are various options:

* (1) use the vendor-provided drivers (and hence make CUPS underneath Samba
   print the jobs as "raw".

* (2) use the Adobe PostScript driver(s) for Windows clients with the same
   PPDs as CUPS would use for its native clients

* (3) use the CUPS PostScript driver (only possible for Windows NT/2K/XP)
   with the same PPDs as CUPS would use for its native clients

Also, there are different methods of installing the drivers into Samba:

* use a combination of manually run "rpcclient" commands (after the actual
   driver files had been put into the [print$] share, f.e. via "smbclient")
   (works for (1), (2) and (3) of above methods -- is very tedious).

* use the "Add Printer Wizard" from a Windows workstation (works for
   (1) and (2) -- if you are familiar with the method and know how to tweak
   it a bit)

* use "cupsaddsmb" (works only for (3) -- but is very comfortable).

Unless I don't know which drivers you exactly do use and how you installed
them, I can't provide more hints.

Can you provide the output of the following commmand, please:

   rpcclient -U <printeradmin> -c "getdriver <printername> 3" <sambahost>

where <printeradmin> :=  the name of a printer admin as per the smb.conf (or root)
       <printername>  :=  the name of a printer showing the problem
       <sambahost>    :=  the name of your CUPS/Samba server

If it doesn't work for you this may be due to an older version of Samba
which suffers from a bug in the "getdriver" subcommand of rpcclient. In
this case, please provide the output of

   rpcclient -U <printeradmin> -c "enumdrivers 3" <sambahost>

> If we configure all settings for a printer from a Windows 2000
> machine, then the settings works fine when a Windows 2000 client adds the
> printer. But when a Windows NT4 client adds the same printer there are no
> settings configured. This is ok, the Windows environments differs and the
> driver versions can differ. Therefore we do the same configuration for the
> printer from a Windows NT4 machine. After that clients running NT4 gets
> correct settings for the printer. Now the bad thing: the configuration of
> the printer for NT4 resets the configuration previously entered for
> Windows 2000! When a Windows 2000 client looks on the settings now they
> are back to the default values as they were before configuration for
> Windows 2000.

Are you aware of the following facts?

* Windows NT printer drivers run in Kernel mode. The respective driver
   files are stored in subdir "2" of "[print$]\W32X86\".

* Windows 2K/XP sports a new concept which by default has printer drivers
   run in User mode. But these drivers need to be written for that...
   User mode driver files are stored in subdir "3" of "[print$]\W32X86\"
   But still, Win2K/XP can use "old-style" drivers (which of course run
   in Kernel mode and store the files in subdir "2" of "[print$]\W32X86\".

> The problem also occurs in the other direction. If we first configure the
> printer for Windows NT4 and then for Windows 2000, then the settings for
> NT4 are reseted after configuration from Windows 2000.
> We have several different brands of printers and therfore different
> Windows drivers, but for most of them it works like the description above.
> A brand new Ricoh printer, with new drivers, works better than above
> though.

Can you say which version of driver this printer has installed for the
respective Win clients (UserMode/3 or KernelMode/2)?

> When we configure the printer under Windows 2000 for that printer,
> then the settings automatically applies to the NT4 settings too and vice
> versa. And it doesn't reset any settings. It seems very much up to the
> driver where and how it stores its settings in the Samba simulated
> registry.
> How do Samba store the settings for different Windows platforms?

Like Windows NT. With the different versions of the drivers in the
"2" and "3" subdirs, and with additional info in various *.tdb files...

> Do Samba
> make difference between different Windows platforms when storing the
> settings? Why are our settings reseted? Is this a known problem and is
> there any way to make it work better? As it is now we can't use Samba as a
> print server frontend for both Windows 2000 and NT4 clients.

I *might* be able to come up with a workaround suggestion to solve
your problem, but it needs time to work it out and test....

> I have recently started to use the tdbutil to look on the database files,
> but haven't come to any conclusions yet.
> Regards,
> --------------------------------------------------------------------------
> Anders Karlsson                        Email:  anders.karlsson at cendio.se


|              .--.                                  CUPS + ESP PrintPro:  |
|             |o_o |                                 ********************  |
|     ~       |:_/ |                Unix/Linux Printing made fun and easy  |
|    ° °     //   \ \               http://www.danka.de/printpro/faq.html  |
|    /V\    (|     | )  .~.         Kurt Pfeifle,  Danka Deutschland GmbH  |
|   // \\  /'\_   _/`\  /V\                Tel.:   +49-172-715.7017        |
|  /(   )\ \___)=(___ )/( )\               mailto:kpfeifle at danka.de        |
|   ^`~'^              ^^~^^                                               |
| Network Printing Services: Consulting+Training+Workshops+Troubleshooting |

More information about the samba mailing list