LPD(8) System Manager's Manual LPD(8)
lpd - printer daemon
/usr/lib/lpd [ -l ] [ -L logfile ] [ port# ]
lpd is the line printer daemon (spool area handler). It is usually
invoked at boot time from the rc(8) script, making a single pass
through the printcap(5) file to find out about the existing printers
and printing any files left after a crash. It then accepts requests to
print files in a queue, transfer files to a spooling area, display a
queue's status, or remove jobs from a queue. In each case, it forks a
child process for each request, and continues to listen for subsequent
The Internet port number used to communicate with other processes is
usually obtained with getservent(3N), but can be specified with the
If a file cannot be opened, an error message is logged using the
LOG_LPR facility of syslog(3). lpd will try up to 20 times to reopen a
file it expects to be there, after which it proceeds to the next file
-l Log valid requests received from the network. This can be use-
ful for debugging purposes.
Change the file used for writing error conditions to logfile.
The default is to report a message using the syslog(3) facility.
Access control is provided by two means. First, all requests must come
from one of the machines listed in either the file /etc/hosts.equiv or
/etc/hosts.lpd. (This latter file is in hosts.equiv(5) format.) Sec-
ond, if the rs capability is specified in the printcap entry, lpr(1)
requests are only be honored for users with accounts on the printer
The lock file in each spool directory is used to prevent multiple dae-
mons from becoming active, and to store information about the daemon
process for lpr(1), lpq(1), and lprm(1).
lpd uses flock(2) to provide exclusive access to the lock file and to
prevent multiple daemons from becoming active simultaneously. If the
daemon should be killed or die unexpectedly, the lock file need not be
removed. The lock file is kept in a readable ASCII form and contains
two lines. The first is the process id of the daemon and the second is
the control file name of the current job being printed. The second
line is updated to reflect the current status of lpd for the programs
lpq(1) and lprm(1).
After the daemon has successfully set the lock, it scans the directory
for files beginning with cf. Lines in each cf file specify files to be
printed or non-printing actions to be performed. Each such line begins
with a key character that indicates what to do with the remainder of
J Job name to print on the burst page.
C Classification line on the burst page.
L Literal. This line contains identification information
from the password file, and causes a burst page to be
T Title string for page headings printed by pr(1V).
H Hostname of the machine where lpr(1) was invoked.
P Person. Login name of the person who invoked lpr(1).
This is used to verify ownership by lprm(1).
M Send mail to the specified user when the current print
f Formatted File, the name of a file to print that is
l Like f, but passes control characters along, and does not
make page breaks.
p Name of a file to print using pr(1V) as a filter.
t Troff File. The file contains troff(1) output (cat pho-
n Ditroff File. The file contains device independent troff
d DVI File. The file contains TEX output (DVI format from
g Graph File. The file contains data produced by plot(3X).
c Cifplot File. The file contains data produced by cifplot.
v The file contains a raster image.
r The file contains text data with FORTRAN carriage control
1 Troff Font R. The name of a font file to use instead of
2 Troff Font I. The name of the font file to use instead of
3 Troff Font B. The name of the font file to use instead of
4 Troff Font S. The name of the font file to use instead of
W Width. Changes the page width (in characters) used by
pr(1V) and the text filters.
I Indent. Specify the number of characters by which to
indent the output.
U Unlink. The name of file to remove upon completion of
N Filename. The name of the file being printed, or a blank
for the standard input (when lpr(1) is invoked in a pipe-
When a file is spooled for printing, the contents are copied into a
data file in the spool directory. Data file names begin with df. When
lpr is called with the -s option, the control files contain a symbolic
link to the actual file, and no data files are created.
The file minfree in each spool directory contains the number of kilo-
bytes to leave free so that the line printer queue won't completely
fill the disk.
/etc/printcap printer description file
/var/spool/* spool directories
minimum free space to leave
/dev/lp* line printer devices
/dev/printer socket for local requests
/etc/hosts.equiv hosts allowed equivalent host access
/etc/hosts.lpd hosts allowed printer access only
lpq(1), lpr(1), lprm(1), hosts(5), hosts.equiv(5), printcap(5), lpc(8),
5 December 1989 LPD(8)