]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.sbin/lpr/lpd/lpd.8
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / usr.sbin / lpr / lpd / lpd.8
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  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       8.3 (Berkeley) 4/19/94
33 .\" $FreeBSD$
34 .\"
35 .Dd June 6, 2001
36 .Dt LPD 8
37 .Os
38 .Sh NAME
39 .Nm lpd
40 .Nd line printer spooler daemon
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl cdlpsW46
44 .Op Ar port#
45 .Sh DESCRIPTION
46 The
47 .Nm
48 utility
49 is the line printer daemon (spool area handler) and is normally invoked
50 at boot time from the
51 .Xr rc 8
52 file.
53 It makes a single pass through the
54 .Xr printcap 5
55 file to find out about the existing printers and
56 prints any files left after a crash.
57 It then uses the system calls
58 .Xr listen 2
59 and
60 .Xr accept 2
61 to receive requests to print files in the queue,
62 transfer files to the spooling area, display the queue,
63 or remove jobs from the queue.
64 In each case, it forks a child to handle
65 the request so the parent can continue to listen for more requests.
66 .Pp
67 Available options:
68 .Bl -tag -width Ds
69 .It Fl c
70 By default, if some remote host has a connection error while trying to
71 send a print request to
72 .Nm
73 on a local host,
74 .Nm
75 will only send error message to that remote host.
76 The
77 .Fl c
78 flag causes
79 .Nm
80 to also log all of those connection errors via
81 .Xr syslog 3 .
82 .It Fl d
83 Turn on
84 .Dv SO_DEBUG
85 on the Internet listening socket (see
86 .Xr setsockopt 2 ) .
87 .It Fl l
88 The
89 .Fl l
90 flag causes
91 .Nm
92 to log valid requests received from the network.
93 This can be useful
94 for debugging purposes.
95 .It Fl p
96 The
97 .Fl p
98 flag is a synonym for the
99 .Fl s
100 flag.
101 It is being deprecated, and may be removed in a
102 future version of
103 .Nm .
104 .It Fl s
105 The
106 .Fl s
107 (secure) flag causes
108 .Nm
109 not to open an Internet listening socket.
110 This means that
111 .Nm
112 will not accept any connections from any remote
113 hosts, although it will still accept print requests
114 from all local users.
115 .It Fl W
116 By default, the
117 .Nm
118 daemon will only accept connections which originate
119 from a reserved-port (<1024) on the remote host.
120 The
121 .Fl W
122 flag causes
123 .Nm
124 to accept connections coming from any port.
125 This is can be useful when you want to accept print jobs
126 from certain implementations of lpr written for Windows.
127 .It Fl 4
128 Inet only.
129 .It Fl 6
130 Inet6 only.
131 .It Fl 46
132 Inet and inet6 (default).
133 .It Ar "port#"
134 The Internet port number used to rendezvous
135 with other processes is normally obtained with
136 .Xr getservbyname 3
137 but can be changed with the
138 .Ar port#
139 argument.
140 .El
141 .Pp
142 Access control is provided by two means.
143 First, all requests must come from
144 one of the machines listed in the file
145 .Pa /etc/hosts.equiv
146 or
147 .Pa /etc/hosts.lpd .
148 Second, if the
149 .Li rs
150 capability is specified in the
151 .Xr printcap 5
152 entry for the printer being accessed,
153 .Em lpr
154 requests will only be honored for those users with accounts on the
155 machine with the printer.
156 .Pp
157 The file
158 .Em minfree
159 in each spool directory contains the number of disk blocks to leave free
160 so that the line printer queue will not completely fill the disk.
161 The
162 .Em minfree
163 file can be edited with your favorite text editor.
164 .Pp
165 The daemon begins processing files
166 after it has successfully set the lock for exclusive
167 access (described a bit later),
168 and scans the spool directory
169 for files beginning with
170 .Em cf .
171 Lines in each
172 .Em cf
173 file specify files to be printed or non-printing actions to be
174 performed.
175 Each such line begins with a key character
176 to specify what to do with the remainder of the line.
177 .Bl -tag -width Ds
178 .It J
179 Job Name.
180 String to be used for the job name on the burst page.
181 .It C
182 Classification.
183 String to be used for the classification line
184 on the burst page.
185 .It L
186 Literal.
187 The line contains identification info from
188 the password file and causes the banner page to be printed.
189 .It T
190 Title.
191 String to be used as the title for
192 .Xr pr 1 .
193 .It H
194 Host Name.
195 Name of the machine where
196 .Xr lpr 1
197 was invoked.
198 .It P
199 Person.
200 Login name of the person who invoked
201 .Xr lpr 1 .
202 This is used to verify ownership by
203 .Xr lprm 1 .
204 .It M
205 Send mail to the specified user when the current print job completes.
206 .It f
207 Formatted File.
208 Name of a file to print which is already formatted.
209 .It l
210 Like ``f'' but passes control characters and does not make page breaks.
211 .It p
212 Name of a file to print using
213 .Xr pr 1
214 as a filter.
215 .It t
216 Troff File.
217 The file contains
218 .Xr troff 1
219 output (cat phototypesetter commands).
220 .It n
221 Ditroff File.
222 The file contains device independent troff
223 output.
224 .It r
225 DVI File.
226 The file contains
227 .Tn Tex l
228 output
229 DVI format from Stanford.
230 .It g
231 Graph File.
232 The file contains data produced by
233 .Xr plot 3 .
234 .It c
235 Cifplot File.
236 The file contains data produced by
237 .Em cifplot .
238 .It v
239 The file contains a raster image.
240 .It r
241 The file contains text data with
242 FORTRAN carriage control characters.
243 .It \&1
244 Troff Font R.
245 Name of the font file to use instead of the default.
246 .It \&2
247 Troff Font I.
248 Name of the font file to use instead of the default.
249 .It \&3
250 Troff Font B.
251 Name of the font file to use instead of the default.
252 .It \&4
253 Troff Font S.
254 Name of the font file to use instead of the default.
255 .It W
256 Width.
257 Changes the page width (in characters) used by
258 .Xr pr 1
259 and the text filters.
260 .It I
261 Indent.
262 The number of characters to indent the output by (in ASCII).
263 .It U
264 Unlink.
265 Name of file to remove upon completion of printing.
266 .It N
267 File name.
268 The name of the file which is being printed, or a blank
269 for the standard input (when
270 .Xr lpr 1
271 is invoked in a pipeline).
272 .It Z
273 Locale.
274 String to be used as the locale for
275 .Xr pr 1 .
276 .El
277 .Pp
278 If a file cannot be opened, a message will be logged via
279 .Xr syslog 3
280 using the
281 .Em LOG_LPR
282 facility.
283 The
284 .Nm
285 utility will try up to 20 times
286 to reopen a file it expects to be there, after which it will
287 skip the file to be printed.
288 .Pp
289 The
290 .Nm
291 utility uses
292 .Xr flock 2
293 to provide exclusive access to the lock file and to prevent multiple
294 daemons from becoming active simultaneously.
295 If the daemon should be killed
296 or die unexpectedly, the lock file need not be removed.
297 The lock file is kept in a readable
298 .Tn ASCII
299 form
300 and contains two lines.
301 The first is the process id of the daemon and the second is the control
302 file name of the current job being printed.
303 The second line is updated to
304 reflect the current status of
305 .Nm
306 for the programs
307 .Xr lpq 1
308 and
309 .Xr lprm 1 .
310 .Sh FILES
311 .Bl -tag -width "/var/spool/*/minfree" -compact
312 .It Pa /etc/printcap
313 printer description file
314 .It Pa /var/spool/*
315 spool directories
316 .It Pa /var/spool/*/minfree
317 minimum free space to leave
318 .It Pa /dev/lp*
319 line printer devices
320 .It Pa /var/run/printer
321 socket for local requests
322 .It Pa /etc/hosts.equiv
323 lists machine names allowed printer access
324 .It Pa /etc/hosts.lpd
325 lists machine names allowed printer access,
326 but not under same administrative control.
327 .El
328 .Sh SEE ALSO
329 .Xr lpq 1 ,
330 .Xr lpr 1 ,
331 .Xr lprm 1 ,
332 .Xr setsockopt 2 ,
333 .Xr syslog 3 ,
334 .Xr hosts.lpd 5 ,
335 .Xr printcap 5 ,
336 .Xr chkprintcap 8 ,
337 .Xr lpc 8 ,
338 .Xr pac 8
339 .Rs
340 .%T "4.2 BSD Line Printer Spooler Manual"
341 .Re
342 .Sh HISTORY
343 An
344 .Nm
345 daemon appeared in Version 6 AT&T UNIX.