When to Pick LPRng

As Table 13.1 reveals, Slackware 9.0 is the only major Linux distribution that uses LPRng as its primary printing system, although several others still ship with LPRng as an alternative system. Just a version or so ago, several other distributions used LPRng as their primary printing systems, so it's likely to be found on many not-too-old Linux installations.

LPRng was designed as a drop-in replacement for BSD LPD. LPRng uses the same network printing protocols as BSD LPD, so computers running these two packages can use each others' printers if they're configured to allow this access. LPRng uses the same /etc/printcap file to define printers as does BSD LPD. Listing 13.1 shows a sample of this file. Technically, each entry is a single line with colon-delimited fields; however, to help make the file readable to humans, entries are typically broken up across multiple lines using backslashes (\), which tell the system to treat the subsequent line as a continuation of the first. Therefore, all lines for an entry except for the last one end in backslashes. All lines save the first are typically indented to help improve readability.

Listing 13.1: Sample /etc/printcap File lp|epson:\

:sd=/var/spool/lp1 :\ :rm=pserver:\ :rp=hplj:\ :mx#0:\

Each /etc/printcap entry begins with one or more queue names, separated by vertical bars (|). In Listing 13.1, the first queue may be referred to as either Ip or epson, while the second is known as Ip1 or hplj. Subsequent lines set features such as the spool directory where printed files are temporarily stored (sd=); the printer device file for local printers (lp=); the remote print server hostname and print queue name for network printers (rm= and rp=, respectively); the maximum size, in kilobytes, of a file the queue will accept, with 0 being a code for no limit (mx#); a command to suppress a header that identifies the user who sent the print job (sh); and the print filter that processes files (if=). Many other options are available to help you fine-tune the behavior of the print queue; consult the printcap man page for further information.

LPRng directly supports both local and network printers. You'll generally include either an lp= entry in /etc/printcap or both rm= and rp= entries. In Listing 13.1, the epson (or Ip) queue is local, using a printer attached to /dev/lpO. The hplj (or Ip1) queue is remote, using a printer called hplj on the computer called pserver.

Tip When naming your print queues, you should try to assign names that match those of the remote printer queue whenever possible. Doing so will minimize any confusion that might result if one printer's name varies depending on the computer from which it is used.

Overall, LPRng can be a convenient print spooler if you're already familiar with its configuration or with BSD LPD. Its default network configuration is not secure, though, as described in the upcoming section, "LPRng Access Control." Therefore, if you use LPRng, you should be sure to close that hole. Also, LPRng suffers from many of the same limitations as BSD LPD—it can't tell applications about a printer's features, and it can't automatically communicate a list of networked printers to potential clients.

0 0

Post a comment