install approved copyright notice
[unix-history] / usr / src / usr.sbin / lpr / lpd / lpd.8
CommitLineData
c6216a8d
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
31c59742 5.\" @(#)lpd.8 6.3 (Berkeley) %G%
c6216a8d 6.\"
278a48a0 7.TH LPD 8 ""
c6216a8d
KM
8.UC 5
9.ad
10.SH NAME
11lpd \- line printer daemon
12.SH SYNOPSIS
13.B /usr/lib/lpd
2c7812a9
EA
14[
15.B \-l
16] [ port # ]
c6216a8d
KM
17.SH DESCRIPTION
18.I Lpd
19is the line printer daemon (spool area handler) and is normally invoked
20at boot time from the
21.IR rc (8)
22file. It makes a single pass through the
23.IR printcap (5)
24file to find out about the existing printers and
25prints any files left after a crash. It then uses the system calls
26.IR listen (2)
27and
28.IR accept (2)
29to receive requests to print files in the queue,
30transfer files to the spooling area, display the queue,
31or remove jobs from the queue. In each case, it forks a child to handle
32the request so the parent can continue to listen for more requests.
33The Internet port number used to rendezvous
34with other processes is normally obtained with
35.IR getservbyname (3)
36but can be changed with the
37.IR port #
2c7812a9 38argument.
c6216a8d
KM
39The
40.B \-l
41flag causes
42.I lpd
43to log valid requests received from the network. This can be useful
44for debugging purposes.
45.PP
46Access control is provided by two means. First, All requests must come from
47one of the machines listed in the file
278a48a0
KM
48.I /etc/hosts.equiv
49or
50.IR /etc/hosts.lpd .
c6216a8d
KM
51Second, if the ``rs'' capability is specified in the
52.I printcap
53entry for the printer being accessed,
54.I lpr
55requests will only be honored for those users with accounts on the
56machine with the printer.
57.PP
58The file
278a48a0
KM
59.I minfree
60in each spool directory contains the number of disk blocks to leave free
61so that the line printer queue won't completely fill the disk.
62The
63.I minfree
64file can be edited with your favorite text editor.
65.PP
66The file
c6216a8d
KM
67.I lock
68in each spool directory is used to prevent multiple daemons from
69becoming active simultaneously, and to store information
70about the daemon process for
71.IR lpr (1),
72.IR lpq (1),
73and
74.IR lprm (1).
75After the daemon has successfully set the lock, it scans the directory
76for files beginning with
77.IR cf .
78Lines in each
79.I cf
80file specify files to be printed or non-printing actions to be
81performed. Each such line begins with a key character
82to specify what to do with the remainder of the line.
83.in +3
84.IP J
85Job Name. String to be used for the job name on the burst page.
86.IP C
87Classification. String to be used for the classification line
88on the burst page.
89.IP L
90Literal. The line contains identification info from
91the password file and causes the banner page to be printed.
92.IP T
93Title. String to be used as the title for
94.IR pr (1).
95.IP H
96Host Name. Name of the machine where
97.I lpr
98was invoked.
99.IP P
100Person. Login name of the person who invoked
101.IR lpr .
102This is used to verify ownership by
103.IR lprm .
104.IP M
105Send mail to the specified user when the current print job completes.
106.IP f
107Formatted File. Name of a file to print which is already formatted.
108.IP l
109Like ``f'' but passes control characters and does not make page breaks.
110.IP p
111Name of a file to print using
112.IR pr (1)
113as a filter.
114.IP t
115Troff File. The file contains
116.IR troff (1)
117output (cat phototypesetter commands).
278a48a0
KM
118.IP n
119Ditroff File. The file contains device independent troff
120output.
c6216a8d
KM
121.IP d
122DVI File. The file contains
123.IR Tex (l)
124output (DVI format from Standford).
125.IP g
126Graph File. The file contains data produced by
127.IR plot (3X).
128.IP c
129Cifplot File. The file contains data produced by
130.IR cifplot .
131.IP v
132The file contains a raster image.
133.IP r
134The file contains text data with FORTRAN carriage control characters.
135.IP 1
136Troff Font R. Name of the font file to use instead of the default.
137.IP 2
138Troff Font I. Name of the font file to use instead of the default.
139.IP 3
140Troff Font B. Name of the font file to use instead of the default.
141.IP 4
142Troff Font S. Name of the font file to use instead of the default.
143.IP W
144Width. Changes the page width (in characters) used by
145.IR pr (1)
146and the text filters.
147.IP I
148Indent. The number of characters to indent the output by (in ascii).
149.IP U
150Unlink. Name of file to remove upon completion of printing.
151.IP N
152File name. The name of the file which is being printed, or a blank
153for the standard input (when
154.I lpr
155is invoked in a pipeline).
156.in -5
157.PP
2c7812a9
EA
158If a file can not be opened, a message will be logged via
159.IR syslog (3)
160using the
161.I LOG_LPR
162facility.
c6216a8d
KM
163.I Lpd
164will try up to 20 times
165to reopen a file it expects to be there, after which it will
166skip the file to be printed.
167.PP
168.I Lpd
169uses
170.IR flock (2)
171to provide exclusive access to the lock file and to prevent multiple
172deamons from becoming active simultaneously. If the daemon should be killed
173or die unexpectedly, the lock file need not be removed.
174The lock file is kept in a readable ASCII form
175and contains two lines.
176The first is the process id of the daemon and the second is the control
177file name of the current job being printed. The second line is updated to
178reflect the current status of
179.I lpd
180for the programs
181.IR lpq (1)
182and
183.IR lprm (1).
184.SH FILES
185.nf
186.ta \w'/etc/printcap 'u
187/etc/printcap printer description file
188/usr/spool/* spool directories
278a48a0 189/usr/spool/*/minfree minimum free space to leave
c6216a8d
KM
190/dev/lp* line printer devices
191/dev/printer socket for local requests
192/etc/hosts.equiv lists machine names allowed printer access
31c59742
KM
193/etc/hosts.lpd lists machine names allowed printer access,
194 but not under same administrative control.
c6216a8d
KM
195.fi
196.SH "SEE ALSO"
197lpc(8),
198pac(1),
199lpr(1),
200lpq(1),
201lprm(1),
2c7812a9 202syslog(3),
c6216a8d
KM
203printcap(5)
204.br
205.ul
2064.2BSD Line Printer Spooler Manual