The lpd Printing Daemon

OpenBSD includes the lpd(8) printing daemon common on Unix-like operating systems. The lpd daemon has options to support thousands of different printers, but getting the right mix of options to support any one specific printer can be a challenge.

The simplest way to use a printer on OpenBSD is through a PostScript server, and that’s the method I’ll cover here. Many modern printers, particularly the popular multifunction fax/scanner/printer combinations, support PostScript, and you’ll find that every office print server does, too.

Every printer your system knows about needs an entry in /etc/printcap, the printer capability database. This is another termcap(5)-style configuration file. You don’t need to know everything about the printer to change settings here. This entry just needs the hostname or IP address of the print server and the print server’s name for the printer you want to access. Then use the following template:

lp|printername:
  :sh=:
  :rm=printservername:
  :sd=/var/spool/output/printername:
  :lf=/var/log/lpd-errs:
  :rp=printername:

The first line gives the printer’s names. Every printer can have any number of names, separated by the pipe (|) symbol. The default printer on a Unix-like system is named lp, so be sure that one of the printers has that name attached to it. Another name should be the one used by the print server for this printer (such as Billing). (Microsoft print servers frequently share one printer under several different names, and each name prints differently, so be sure to use the name that represents the PostScript facility.)

The other lines list attributes:

  • By default, lpd precedes each print job with a page giving the job name, number, host, and other identifying information. This used to be important when people paid for printing by the page, but unless you’re in an environment with a single, massive printer, this probably wastes paper. The :sh:= entry suppresses this page.

  • The :rm= attribute gives the hostname or IP address of the print server. You must be able to ping the print server by this name.

  • Printing works best if each printer has a unique spool directory, given by the :sd= attribute. The printer daemon stores documents en route to the print server here. This directory must be owned by the user root and the group daemon.

  • Several printers can share a common log file, shown by the :lf= attribute.

  • Finally, specify the remote printer name with the :rp= attribute. This last attribute is the only one that doesn’t end with a backslash.

Always end /etc/printcap with a newline. I usually use an entire blank line, just to be certain.

Now that you have a printer configuration, you start lpd at boot with this rc.conf.local entry:

lpd_flags=""

Restart lpd with /etc/rc.d/lpd restart any time you edit /etc/printcap.

Finally, view the print queue with lpq(1), and watch /var/log/lpd-errs for problems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.3.175