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