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