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