12.3. Simple Server Printcap Example

Options used:

The previous section discussed printcap entries for use by the client programs. Now we will discuss printcap entries for use by the lpd server. In simple configurations or when we have the force_localhost option enabled we can use the same printcap for both LPRng clients and the lpd server.

# Local ASCII printer
lp1|printer
  :server
  :cm=Dumb printer
  :lp=/dev/lp1
  :sd=/var/spool/lpd/lp1
  :lf=log:af=acct
  :filter=/usr/local/libexec/filters/ifhp
  :mx=0
  1. The printcap entry name is lp1. This information will be displayed when requesting status information using the lpq program.

  2. The printer alias. This allows a single spool queue to have multiple names.

  3. The :server option specifies this printcap entry is only used by lpd server.

  4. The :cm field supplies a information field for lpq (printer status) output.

  5. The :lp value specifies the destination file, device or remote spool queue to which data is sent. In this example it is the device /dev/lp1. By default, IO devices are opened for write-only operation.

  6. The :sd=/path specifies the spool directory where print job files are stored until they are printed.

  7. The :lf and :af options specify the names of the log and accounting files, respectively. These have the default values log and acct respectively. If not an absolute path, the file is relative to the spool queue directory. If these files don't exist, they will not be created, and no logging or accounting will be done. You will need to create them manually (e.g., by using touch) or by using the checkpc program. If you do not want a log or accounting file, then use :lf=, i.e. - no value.

  8. The :filter=/path option specifies a filter program to be used to process job files. Filters and print formats are discussed in Filters.

  9. mx indicates the maximum file size for a print job. Specifying 0 means that there is no limit.