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