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