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