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