Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: CUPS and Open Directory printers in OS X Server Printers
Well, this one had been plaguing me ever since which switched our systems over to Leopard in Summer 2008. I found very few hints and nothing that really led to a solution. The following isn't a true solution either; it's more of a brute-force work-around. As of the writing of this post, we are running 10.5.6 across the board and still require this workaround.

First, the problem: You upgraded to Leopard Server and want to push printers out to your clients. You set up your Open Directory (OD) workgroups and computer groups, configure your printers on your print server, then drag them into the User's Printer List in Workgroup Manager (WGM). Check your clients, and sure enough -- all the printers are there, happy as can be. You go on with your day.

In no time at all, everyone is calling because the printers aren't responding as intended. Printers pause for users at random, and demand administrative credentials before they'll start again. Also, if you have a fancy network printer, and want to force duplexing (great for an academic setting), none of those preferences fall through to the clients. What a mess!

Now, the workaround: By understanding what OD is telling the clients and what the clients do with this information, you can trick CUPS into doing what you want. When OD tells a client that it needs to have a certain set of printers configured, all it tells the client is the type of printer, its location, and what name you've given it. This info is dumped into /etc/cups/printers.conf.

If there is an existing printers.conf file, the system will copy it to printers.conf.0, and build a new file incorporating some of the settings from the old one with the new Info, Location, and DeviceURI from OD. So, setting OpPolicy and ErrorPolicy can be done for each printer and retained every time OD refreshes the settings. You can just push out the modified printer.conf to each machine via Apple Remote Desktop (ARD). The big issue for me was setting things like duplexing and default trays, which need to be set in the PPD file for the printer.

Every time OD refreshes the system, it builds a new mcx_#.ppd file on the client for each distributed printer. At first, I assumed that these PPDs were coming down from the print server, but I was mistaken. They are created from the default PPD file for that model printer, stored in /Library » Printers » PPDs » Contents » Resources. To be able to set the default settings for a printer (duplexing, add-ons, default tray, etc.), I just replaced the default PPD with my own custom one.

The easiest way to do this is to configure the printer exactly how you like each client to talk to it, but on you local machine. Just open the CUPS interface in a browser: http://localhost:631. Configure to your heart's delight, then save everything. Now, you need to find the PPD file for that printer in /Library » Printers » PPDs » Contents » Resources. It will have a filename that is close or identical to the Printer Driver as listed in CUPS. Make a backup of this file (just in case):
mv default_printer.gz default_printer.gz.orignal
Next, prep a copy of your customized PPD and move it over to where the default used to be. You need to strip the file extension from the file and then run it through gzip first. Be sure to give the destination file the same name the file that you backed up earlier.
$ cd /etc/cups
$ cp customized_printer.ppd customized_printer
$ gzip customized_printer
$ mv customized_printer.gz /Library/Printers/PPDs/Contents/Resources/default_printer.gz
(Replace default_printer and customized_printer file references with the correct filenames for your setup.)

Now, for every instance of that model printer that is created by OD, they'll all have your custom settings. Unfortunately, that means that you can't modify settings entirely en mass, and you still need to push the customized .gz file to each workstation that will need it. This is easy enough with ARD, though.

If you have multiple printers of the same model, but need different configurations for each, you could just distribute the customized .gz to the workstations that require it. At least you don't have to go around to each workstation and configure the printers manually. Hope this helps someone.
  • Currently 2.44 / 5
  You rated: 1 / 5 (9 votes cast)

10.5: CUPS and Open Directory printers in OS X Server | 2 comments | Create New Account
Click here to return to the '10.5: CUPS and Open Directory printers in OS X Server' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: CUPS and Open Directory printers in OS X Server
Authored by: ptone on Jan 28, '09 11:15:58AM

I avoid the whole mess by creating printers dynamically with a loginscript that creates the printers (with all the options I want) with lpadmin. This loginscript is pulled from a network at each login - so its easy to tweak anything needed.


[ Reply to This | # ]
10.5: CUPS and Open Directory printers in OS X Server
Authored by: hunty on Jan 28, '09 04:08:48PM

you can also specify which driver each printer uses in workgroup manager
under the mcx printers key (in the details section of the preferences), each printer shows a filepath to the default ppd driver, you can change this path to the actual driver path that exisits on the client workstation

[ Reply to This | # ]