lpd(8)lpd(8)NAMElpd - line printer daemon
SYNOPSIS
/usr/lbin/lpd [-l]
OPTIONS
Causes the lpd daemon to log valid requests received from the network.
This option is useful for debugging.
DESCRIPTION
The lpd line printer daemon (spool area handler) normally is invoked at
boot time. The daemon makes a single pass through the printcap(4) file
to determine the existing printers and to print all files that were not
printed before the system shut down. The daemon uses system calls lis‐
ten(2) and accept(2) to receive requests to print files in the queue,
to transfer files to the spooling area, and to display the queue or
remove jobs from the queue. In each case, the daemon forks a child
process to handle the request so that the parent process can continue
to listen for more requests. The Internet port number used to interact
with other processes is identified with the getservbyname(3) system
call and is specified in the /etc/services file by its printer service
record entry.
Access control is provided by the following means:
All requests must originate from one of the machines listed in the
/etc/hosts.equiv or /etc/hosts.lpd file.
When an rs capability, which restricts remote users to those with local
accounts, is specified in the /etc/printcap file for the printer being
accessed, an lpr or lp request is honored only for those users having
accounts on the same machine as the printer.
The minfree ASCII file in each spool directory contains the number of
disk blocks to leave free so that the line printer queue will not com‐
pletely fill the disk.
The lock file in each /usr/spool subdirectory is used to prevent more
than one active lpd daemon and to store information about the daemon
process for other printer spooling commands.
After the lpd daemon has successfully set the lock in the lock file, it
scans the /usr/spool subdirectory for files beginning with the charac‐
ters cf. Records in each of the cf files specify files to be printed
or specify one or more non-printing actions to be performed. Each such
record begins with a key character that specifies what to do with the
remainder of the line. In the following table, the columns list the
beginning key character, the key-character name, and its purpose: Name
of the machine where the lpr daemon or the lp command was invoked.
Login name of the person who invoked the lpr or lp commands. This
record is used to verify ownership by the lprm or cancel commands.
String to be used for the job name on the burst page. String to be
used for the classification line on the burst page. The record line
provides identification information from the etc/passwd file and initi‐
ates banner page printing. The number of character spaces to indent
the output (spacing is from the ASCII character set). Sends mail to
the specified user when the current print job completes. Name of
another font file to use in place of the default font file. Name of
another font file to use in place of the default font file. Name of
another font file to use in place of the default font file. Name of
another font file to use in place of the default font file. Changes
the page width (in characters) used by the pr command and by text fil‐
ters. Selects the input tray that supplies paper for the print job.
Selects the output tray where the printed paper is deposited. Speci‐
fies the orientation of the printed output on the page. Note that for
certain print filters, such as pcfof, the O option is used to specify
other options such as even to print even-numbered pages. Specifies
whether the job should be printed on both sides of the physical sheet
and whether the pages should be rotated by 180 degrees. String to be
used as the title for the pr command. Name of an already formatted
file to print. Name of a file to print using the pr command as a fil‐
ter. Similar to f, but passes control characters and does not make
page breaks. The file contains troff output (cat phototypesetter com‐
mands). The file contains DVI (device-independent) troff output. The
file contains Tex(l) output (DVI format from Stanford). The file con‐
tains a raster image. The file contains data produced by the cifplot
command. The file contains text data with Fortran carriage control
characters. Do not interpret any control characters in the file. Name
of file to remove on completion of printing. The name of the file
undergoing printing, or when blank, for the standard input (when the
lpr or lp command is invoked in a pipeline or when the command is
invoked from the standard input).
Whenever a file cannot be opened for printing, a message is logged via
the syslog(3) subroutine using theLOG_LPR facility. In this case, the
lpd daemon tries to reopen a file, which it expects to be referenced by
a correct pathname, up to 20 times. If a file cannot be opened after
20 tries, lpd goes to the next file.
The
lpd daemon uses the flock(2) system call to provide exclusive access to
the lock file and to prevent multiple daemons from being simultaneously
activated. If the daemon is killed or dies unexpectedly, the lock file
does not have to be removed.
The 2-line ASCII /usr/spool/lock file contains two lines. The first
line specifies the process ID of the daemon, and the second line speci‐
fies the control file name of the job currently undergoing printing.
The second line is updated to reflect the current status of the lpd
daemon for commands lpq, lprm, cancel, and lpstat.
NOTE - Printer Log Files
The lpd does not automatically purge log files. You should monitor
logs regularly or set up a cleaning task using the cron command. See
similar commands for syslog.dated in /usr/var/spool/cron/crontabs
FILES
Specifies the command path. Printer description file. Spool directo‐
ries. The location of spool directories is a convention, but not nec‐
essary (see the /etc/printcap file). The transient lock file which
records print daemon and job status. On clustered systems, this tran‐
sient file is created to contain the daemon status. Note that the
/usr/spool/lpd directory is a Context Dependent Symbolic Link (CDSL)
and should not be manually created or destroyed. Minimum free disk
space to leave. Line printer devices. Socket for local requests.
Lists machine names allowed access to a printer. Lists machine names
allowed access to a printer, but which are not under same administra‐
tive control.
SEE ALSO
Commands: cancel(1), lp(1), lpc(8), lpr(1), lpq(1), lpstat(1), lprm(1),
pac(8), pcfof(8)
Calls: syslog(3)lpd(8)