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