Printing with CUPS, Part 2
Each variant of Unix has its own printing system with its own unique behaviors and shortcomings. CUPS, the Common Unix Printing System, is a free single-solution tool for Unix and Linux that standardizes printing in these environments. In this second article of a two-part series, Carla Schroder explores using CUPS with networked printers, including network-direct, and Windows servers and clients.
Each variant of Unix has its own printing system with its own unique behaviors and shortcomings. CUPS, the Common Unix Printing System, is a free single-solution tool for Unix and Linux that standardizes printing in these environments. In this second article of my two-part series focusing on CUPS, we'll explore using CUPS with networked printers, including network-direct, and Windows servers and clients.
CUPS Printer Server
The online CUPS Software Administrator's manual, excellent as it is, is not completely up-to-date on connecting client machines. My manual claims that CUPS automatically broadcasts itself on its own subnet, and becomes automagically available to clients. While older editions of CUPS did indeed do this, the latest editions do not accept connections from client machines by default; rather, this option must first be enabled. (I am using CUPS 1.1.15; if the manuals have been corrected in more recent versions, hurrah!)
First, the print server needs a static IP, and then some edits must be made to cupsd.conf. In cupsd.conf, find:
Deny From All
Allow From 127.0.0.1
Add the local network information using values appropriate for your network:
Allow from 192.168.1
Then find the BrowseAddress section and specify the broadcast address:
Restart CUPS. The default browse interval is 30 seconds, so within short order, Linux client machines will display all installed printers in their CUPS web interfaces (or you can get the information using the lpstat -t command). The browse interval is configurable.
Printers are organized into classes; by default, they are all lumped into a single class. Print jobs sent to a class will go to the first available printer. Classes can even contain their own classes, which are useful for organizing distributed high-volume printing. CUPS creates implicit classes when more than one server points to a particular printer, which ensures that the print jobs still get through if one server goes down.
CUPS supports printer-based quotas. They cannot be configured per user, though; for example, a daily quota of 10 pages on the expensive color plotter will apply to all users. However, each user will be logged individually. Quotas can be either numbers of pages or kilobytes.
# lpadmin -p expensive_plotter -o job-quota-period=604800 -o job-page-limit=10
# lpadmin -p expensive_plotter -o job-quota-period=604800 -o job-k-limit=1048576
Logs are kept in /var/log/cups. They are automatically rotated. Everything is logged — individual print jobs with time, date, and user; errors; and each page, with the printer it was sent to.
Printers that connect directly to a hub or switch, such as HP Jet Direct printers, are added by selecting AppSocket/HP JetDirect in the CUPS 'Add Printer' menu. These normally connect on port 9100, so the deviceURI looks like socket://[hostname or IP]:9100.