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