386BSD 0.1 development
[unix-history] / usr / src / usr.sbin / lpr / lpd / lpd.8
CommitLineData
a31f3663
WJ
1.\" Copyright (c) 1983, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)lpd.8 6.6 (Berkeley) 3/16/91
33.\"
34.Dd March 16, 1991
35.Dt LPD 8
36.Os BSD 4.2
37.Sh NAME
38.Nm lpd
39.Nd line printer spooler daemon
40.Sh SYNOPSIS
41.Nm lpd
42.Op Fl l
43.Op Ar port#
44.Sh DESCRIPTION
45.Nm Lpd
46is the line printer daemon (spool area handler) and is normally invoked
47at boot time from the
48.Xr rc 8
49file. It makes a single pass through the
50.Xr printcap 5
51file to find out about the existing printers and
52prints any files left after a crash. It then uses the system calls
53.Xr listen 2
54and
55.Xr accept 2
56to receive requests to print files in the queue,
57transfer files to the spooling area, display the queue,
58or remove jobs from the queue. In each case, it forks a child to handle
59the request so the parent can continue to listen for more requests.
60.Pp
61Available options:
62.Bl -tag -width Ds
63.It Fl l
64The
65.Fl l
66flag causes
67.Nm lpd
68to log valid requests received from the network. This can be useful
69for debugging purposes.
70.It Ar "port#"
71The Internet port number used to rendezvous
72with other processes is normally obtained with
73.Xr getservbyname 3
74but can be changed with the
75.Ar port#
76argument.
77.El
78.Pp
79Access control is provided by two means. First, all requests must come from
80one of the machines listed in the file
81.Pa /etc/hosts.equiv
82or
83.Pa /etc/hosts.lpd .
84Second, if the
85.Li rs
86capability is specified in the
87.Xr printcap
88entry for the printer being accessed,
89.Em lpr
90requests will only be honored for those users with accounts on the
91machine with the printer.
92.Pp
93The file
94.Em minfree
95in each spool directory contains the number of disk blocks to leave free
96so that the line printer queue won't completely fill the disk.
97The
98.Em minfree
99file can be edited with your favorite text editor.
100.Pp
101The daemon begins processing files
102after it has successfully set the lock for exclusive
103access (descibed a bit later),
104and scans the spool directory
105for files beginning with
106.Em cf .
107Lines in each
108.Em cf
109file specify files to be printed or non-printing actions to be
110performed. Each such line begins with a key character
111to specify what to do with the remainder of the line.
112.Bl -tag -width Ds
113.It J
114Job Name. String to be used for the job name on the burst page.
115.It C
116Classification. String to be used for the classification line
117on the burst page.
118.It L
119Literal. The line contains identification info from
120the password file and causes the banner page to be printed.
121.It T
122Title. String to be used as the title for
123.Xr pr 1 .
124.It H
125Host Name. Name of the machine where
126.Xr lpr
127was invoked.
128.It P
129Person. Login name of the person who invoked
130.Xr lpr .
131This is used to verify ownership by
132.Xr lprm .
133.It M
134Send mail to the specified user when the current print job completes.
135.It f
136Formatted File. Name of a file to print which is already formatted.
137.It l
138Like ``f'' but passes control characters and does not make page breaks.
139.It p
140Name of a file to print using
141.Xr pr 1
142as a filter.
143.It t
144Troff File. The file contains
145.Xr troff 1
146output (cat phototypesetter commands).
147.It n
148Ditroff File. The file contains device independent troff
149output.
150.It r
151DVI File. The file contains
152.Tn Tex l
153output
154DVI format from Standford).
155.It g
156Graph File. The file contains data produced by
157.Xr plot 3 .
158.It c
159Cifplot File. The file contains data produced by
160.Em cifplot .
161.It v
162The file contains a raster image.
163.It r
164The file contains text data with
165FORTRAN carriage control characters.
166.It \&1
167Troff Font R. Name of the font file to use instead of the default.
168.It \&2
169Troff Font I. Name of the font file to use instead of the default.
170.It \&3
171Troff Font B. Name of the font file to use instead of the default.
172.It \&4
173Troff Font S. Name of the font file to use instead of the default.
174.It W
175Width. Changes the page width (in characters) used by
176.Xr pr 1
177and the text filters.
178.It I
179Indent. The number of characters to indent the output by (in ascii).
180.It U
181Unlink. Name of file to remove upon completion of printing.
182.It N
183File name. The name of the file which is being printed, or a blank
184for the standard input (when
185.Xr lpr
186is invoked in a pipeline).
187.El
188.Pp
189If a file can not be opened, a message will be logged via
190.Xr syslog 3
191using the
192.Em LOG_LPR
193facility.
194.Nm Lpd
195will try up to 20 times
196to reopen a file it expects to be there, after which it will
197skip the file to be printed.
198.Pp
199.Nm Lpd
200uses
201.Xr flock 2
202to provide exclusive access to the lock file and to prevent multiple
203deamons from becoming active simultaneously. If the daemon should be killed
204or die unexpectedly, the lock file need not be removed.
205The lock file is kept in a readable
206.Tn ASCII
207form
208and contains two lines.
209The first is the process id of the daemon and the second is the control
210file name of the current job being printed. The second line is updated to
211reflect the current status of
212.Nm lpd
213for the programs
214.Xr lpq 1
215and
216.Xr lprm 1 .
217.Sh FILES
218.Bl -tag -width "/var/spool/*/minfree" -compact
219.It Pa /etc/printcap
220printer description file
221.It Pa /var/spool/*
222spool directories
223.It Pa /var/spool/*/minfree
224minimum free space to leave
225.It Pa /dev/lp*
226line printer devices
227.It Pa /dev/printer
228socket for local requests
229.It Pa /etc/hosts.equiv
230lists machine names allowed printer access
231.It Pa /etc/hosts.lpd
232lists machine names allowed printer access,
233but not under same administrative control.
234.El
235.Sh SEE ALSO
236.Xr lpc 8 ,
237.Xr pac 1 ,
238.Xr lpr 1 ,
239.Xr lpq 1 ,
240.Xr lprm 1 ,
241.Xr syslog 3 ,
242.Xr printcap 5
243.Rs
244.%T "4.2 BSD Line Printer Spooler Manual"
245.Re
246.Sh HISTORY
247An
248.Nm
249daemon appeared in Version 6 AT&T UNIX.