xref: /freebsd/usr.sbin/lpr/lpd/lpd.8 (revision ee2ea5ceafed78a5bd9810beb9e3ca927180c226)
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
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 is a synonym for the
95.Fl s
96flag.
97It is being depreciated, 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 disk blocks to leave free
156so that the line printer queue won't 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.  Each such line begins with a key character
171to specify what to do with the remainder of the line.
172.Bl -tag -width Ds
173.It J
174Job Name.  String to be used for the job name on the burst page.
175.It C
176Classification.  String to be used for the classification line
177on the burst page.
178.It L
179Literal.  The line contains identification info from
180the password file and causes the banner page to be printed.
181.It T
182Title.  String to be used as the title for
183.Xr pr 1 .
184.It H
185Host Name.  Name of the machine where
186.Xr lpr
187was invoked.
188.It P
189Person.  Login name of the person who invoked
190.Xr lpr .
191This is used to verify ownership by
192.Xr lprm .
193.It M
194Send mail to the specified user when the current print job completes.
195.It f
196Formatted File.  Name of a file to print which is already formatted.
197.It l
198Like ``f'' but passes control characters and does not make page breaks.
199.It p
200Name of a file to print using
201.Xr pr 1
202as a filter.
203.It t
204Troff File.  The file contains
205.Xr troff 1
206output (cat phototypesetter commands).
207.It n
208Ditroff File.  The file contains device independent troff
209output.
210.It r
211DVI File.  The file contains
212.Tn Tex l
213output
214DVI format from Standford.
215.It g
216Graph File.  The file contains data produced by
217.Xr plot 3 .
218.It c
219Cifplot File.
220The file contains data produced by
221.Em cifplot .
222.It v
223The file contains a raster image.
224.It r
225The file contains text data with
226FORTRAN carriage control characters.
227.It \&1
228Troff Font R. Name of the font file to use instead of the default.
229.It \&2
230Troff Font I. Name of the font file to use instead of the default.
231.It \&3
232Troff Font B. Name of the font file to use instead of the default.
233.It \&4
234Troff Font S. Name of the font file to use instead of the default.
235.It W
236Width.
237Changes the page width (in characters) used by
238.Xr pr 1
239and the text filters.
240.It I
241Indent.  The number of characters to indent the output by (in ASCII).
242.It U
243Unlink.  Name of file to remove upon completion of printing.
244.It N
245File name.  The name of the file which is being printed, or a blank
246for the standard input (when
247.Xr lpr
248is invoked in a pipeline).
249.It Z
250Locale.  String to be used as the locale for
251.Xr pr 1 .
252.El
253.Pp
254If a file cannot be opened, a message will be logged via
255.Xr syslog 3
256using the
257.Em LOG_LPR
258facility.
259.Nm Lpd
260will try up to 20 times
261to reopen a file it expects to be there, after which it will
262skip the file to be printed.
263.Pp
264.Nm Lpd
265uses
266.Xr flock 2
267to provide exclusive access to the lock file and to prevent multiple
268daemons from becoming active simultaneously.  If the daemon should be killed
269or die unexpectedly, the lock file need not be removed.
270The lock file is kept in a readable
271.Tn ASCII
272form
273and contains two lines.
274The first is the process id of the daemon and the second is the control
275file name of the current job being printed.  The second line is updated to
276reflect the current status of
277.Nm
278for the programs
279.Xr lpq 1
280and
281.Xr lprm 1 .
282.Sh FILES
283.Bl -tag -width "/var/spool/*/minfree" -compact
284.It Pa /etc/printcap
285printer description file
286.It Pa /var/spool/*
287spool directories
288.It Pa /var/spool/*/minfree
289minimum free space to leave
290.It Pa /dev/lp*
291line printer devices
292.It Pa /var/run/printer
293socket for local requests
294.It Pa /etc/hosts.equiv
295lists machine names allowed printer access
296.It Pa /etc/hosts.lpd
297lists machine names allowed printer access,
298but not under same administrative control.
299.El
300.Sh SEE ALSO
301.Xr lpq 1 ,
302.Xr lpr 1 ,
303.Xr lprm 1 ,
304.Xr setsockopt 2 ,
305.Xr syslog 3 ,
306.Xr hosts.lpd 5 ,
307.Xr printcap 5 ,
308.Xr chkprintcap 8 ,
309.Xr lpc 8 ,
310.Xr pac 8
311.Rs
312.%T "4.2 BSD Line Printer Spooler Manual"
313.Re
314.Sh HISTORY
315An
316.Nm
317daemon appeared in Version 6 AT&T UNIX.
318