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