xref: /netbsd/usr.sbin/lpr/lpd/lpd.8 (revision bf9ec67e)
1.\"	$NetBSD: lpd.8,v 1.23 2002/02/08 01:38:50 ross Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"     @(#)lpd.8	8.3 (Berkeley) 4/19/94
35.\"
36.Dd October 3, 2000
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 dlsrW
45.Op Fl b Ar bind-address
46.Op Fl n Ar maxchild
47.Op Fl w Ar maxwait
48.Op port
49.Sh DESCRIPTION
50.Nm
51is the line printer daemon (spool area handler) and is normally invoked
52at boot time from the
53.Xr rc 8
54file.
55It makes a single pass through the
56.Xr printcap 5
57file to find out about the existing printers and prints any files
58left after a crash.
59It then uses the system calls
60.Xr listen 2
61and
62.Xr accept 2
63to receive requests to print files in the queue, transfer files to
64the spooling area, display the queue, or remove jobs from the queue.
65In each case, it forks a child to handle the request so the parent
66can continue to listen for more requests.
67.Pp
68Available options:
69.Bl -tag -width Ds
70.It Fl b
71Normally, if the
72.Fl s
73option is not specified,
74.Nm
75will listen on all network interfaces for incoming TCP connections.
76The
77.Fl b
78option, followed by a
79.Ar bind-address
80specifies that
81.Nm
82should listen on that address instead of INADDR_ANY. Multiple
83.Fl b
84options are permitted, allowing a list of addresses to be specified.
85Use of this option silently overrides the
86.Fl s
87option if it is also present on the command line.
88.Ar bind-address
89can be a numeric host name in IPV4 or IPV6 notation, or a symbolic host
90name which will be looked up in the normal way.
91.It Fl d
92The
93.Fl d
94option turns on the
95.Dv SO_DEBUG
96.Xr socket 2
97option.  See
98.Xr setsockopt 2
99for more details.
100.It Fl l
101The
102.Fl l
103flag causes
104.Nm
105to log valid requests received from the network.
106This can be useful for debugging purposes.
107.It Fl n
108The
109.Fl n
110flag sets
111.Ar maxchild
112as the maximum number of child processes that
113.Nm
114will spawn.  The default is 32.
115.It Fl r
116The
117.Fl r
118flag allows the
119.Dq of
120filter to be use if specified for a remote
121printer.  Traditionally,
122.Nm
123would not use the output filter for remote printers.
124.It Fl s
125The
126.Fl s
127flag selects
128.Dq secure
129mode, in which
130.Nm
131does not listen on a TCP socket but only takes commands from a
132.Ux
133domain socket.
134This is valuable when the machine on which
135.Nm
136runs is subject to attack over the network and it is desired that the
137machine be protected from attempts to remotely fill spools and similar
138attacks.
139.It Fl w
140The
141.Fl w
142flag sets
143.Ar maxwait
144as the wait time (in seconds) for dead remote server detection.  If
145no response is returned from a connected server within this period,
146the connection is closed and a message logged.  The default is
147120 seconds.
148.It Fl W
149The
150.Fl W
151option will instruct lpd not to verify a remote tcp connection
152comes from a reserved port (\*[Lt]1024).
153.El
154.Pp
155If the
156.Op port
157parameter is passed,
158.Nm
159listens on this port instead of the usual
160.Dq printer/tcp
161port from
162.Pa /etc/services .
163.Pp
164Access control is provided by two means.
165First, all requests must come from one of the machines listed in
166the file
167.Pa /etc/hosts.equiv
168or
169.Pa /etc/hosts.lpd .
170Second, if the
171.Li rs
172capability is specified in the
173.Xr printcap 5
174entry for the printer being accessed,
175.Em lpr
176requests will only be honored for those users with accounts on the
177machine with the printer.
178.Pp
179The file
180.Em minfree
181in each spool directory contains the number of disk blocks to leave free
182so that the line printer queue won't completely fill the disk.
183The
184.Em minfree
185file can be edited with your favorite text editor.
186.Pp
187The daemon begins processing files
188after it has successfully set the lock for exclusive
189access (described a bit later),
190and scans the spool directory
191for files beginning with
192.Em cf .
193Lines in each
194.Em cf
195file specify files to be printed or non-printing actions to be performed.
196Each such line begins with a key character to specify what to do
197with the remainder of the line.
198.Bl -tag -width Ds
199.It J
200Job Name.
201String to be used for the job name on the burst page.
202.It C
203Classification.
204String to be used for the classification line
205on the burst page.
206.It L
207Literal.
208The line contains identification info from the password file and
209causes the banner page to be printed.
210.It T
211Title.
212String to be used as the title for
213.Xr pr 1 .
214.It H
215Host Name.
216Name of the machine where
217.Xr lpr 1
218was invoked.
219.It P
220Person.
221Login name of the person who invoked
222.Xr lpr 1 .
223This is used to verify ownership by
224.Xr lprm 1 .
225.It M
226Send mail to the specified user when the current print job completes.
227.It f
228Formatted File.
229Name of a file to print which is already formatted.
230.It l
231Like
232.Dq f
233but passes control characters and does not make page breaks.
234.It p
235Name of a file to print using
236.Xr pr 1
237as a filter.
238.It t
239Troff File.
240The file contains
241.Xr troff 1
242output (cat phototypesetter commands).
243.It n
244Ditroff File.
245The file contains device independent troff
246output.
247.It r
248DVI File.
249The file contains
250.Tn Tex l
251output
252DVI format from Standford.
253.It g
254Graph File.
255The file contains data produced by
256.Ic plot .
257.It c
258Cifplot File.
259The file contains data produced by
260.Ic cifplot .
261.It v
262The file contains a raster image.
263.It r
264The file contains text data with
265FORTRAN carriage control characters.
266.It \&1
267Troff Font R.
268Name of the font file to use instead of the default.
269.It \&2
270Troff Font I.
271Name of the font file to use instead of the default.
272.It \&3
273Troff Font B.
274Name of the font file to use instead of the default.
275.It \&4
276Troff Font S.
277Name of the font file to use instead of the default.
278.It W
279Width.
280Changes the page width (in characters) used by
281.Xr pr 1
282and the text filters.
283.It I
284Indent.
285The number of characters to indent the output by (in ascii).
286.It U
287Unlink.
288Name of file to remove upon completion of printing.
289.It N
290File name.
291The name of the file which is being printed, or a blank for the
292standard input (when
293.Xr lpr 1
294is invoked in a pipeline).
295.El
296.Pp
297If a file cannot be opened, a message will be logged via
298.Xr syslog 3
299using the
300.Em LOG_LPR
301facility.
302.Nm
303will try up to 20 times to reopen a file it expects to be there,
304after which it will skip the file to be printed.
305.Pp
306.Nm
307uses
308.Xr flock 2
309to provide exclusive access to the lock file and to prevent multiple
310daemons from becoming active simultaneously.
311If the daemon should be killed or die unexpectedly, the lock file
312need not be removed.
313The lock file is kept in a readable
314.Tn ASCII
315form and contains two lines.
316The first is the process id of the daemon and the second is the control
317file name of the current job being printed.
318The second line is updated to reflect the current status of
319.Nm
320for the programs
321.Xr lpq 1
322and
323.Xr lprm 1 .
324.Sh FILES
325.Bl -tag -width "/var/spool/output/*/minfree" -compact
326.It Pa /etc/printcap
327printer description file
328.It Pa /var/spool/output/*
329spool directories
330.It Pa /var/spool/output/*/minfree
331minimum free space to leave
332.It Pa /dev/lp*
333line printer devices
334.It Pa /var/run/printer
335socket for local requests
336.It Pa /etc/hosts.equiv
337lists machine names allowed printer access
338.It Pa /etc/hosts.lpd
339lists machine names allowed printer access,
340but not under same administrative control.
341.El
342.Sh SEE ALSO
343.Xr lpq 1 ,
344.Xr lpr 1 ,
345.Xr lprm 1 ,
346.Xr setsockopt 2 ,
347.Xr syslog 3 ,
348.Xr hosts.equiv 5 ,
349.Xr printcap 5 ,
350.Xr lpc 8 ,
351.Xr pac 8
352.Rs
353.%T "4.3 BSD Line Printer Spooler Manual"
354.Re
355.Sh HISTORY
356An
357.Nm
358daemon appeared in Version 6 AT\*[Am]T UNIX.
359