xref: /freebsd/usr.sbin/lpr/lpd/lpd.8 (revision 490d5836b5ab0c76675986696b1637fff97dfae2)
1dea673e9SRodney W. Grimes.\" Copyright (c) 1983, 1991, 1993
2dea673e9SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3dea673e9SRodney W. Grimes.\"
4dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6dea673e9SRodney W. Grimes.\" are met:
7dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11dea673e9SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12dea673e9SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
13dea673e9SRodney W. Grimes.\"    must display the following acknowledgement:
14dea673e9SRodney W. Grimes.\"	This product includes software developed by the University of
15dea673e9SRodney W. Grimes.\"	California, Berkeley and its contributors.
16dea673e9SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
17dea673e9SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
18dea673e9SRodney W. Grimes.\"    without specific prior written permission.
19dea673e9SRodney W. Grimes.\"
20dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23dea673e9SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30dea673e9SRodney W. Grimes.\" SUCH DAMAGE.
31dea673e9SRodney W. Grimes.\"
32dea673e9SRodney W. Grimes.\"     @(#)lpd.8	8.3 (Berkeley) 4/19/94
3397d92980SPeter Wemm.\" $FreeBSD$
34dea673e9SRodney W. Grimes.\"
356ddb63caSGarance A Drosehn.Dd June 06, 2001
36dea673e9SRodney W. Grimes.Dt LPD 8
37a4c37c81SRuslan Ermilov.Os
38dea673e9SRodney W. Grimes.Sh NAME
39dea673e9SRodney W. Grimes.Nm lpd
40dea673e9SRodney W. Grimes.Nd line printer spooler daemon
41dea673e9SRodney W. Grimes.Sh SYNOPSIS
42e97407b4SRuslan Ermilov.Nm
43c7e56d32SGarance A Drosehn.Op Fl cdlpsW46
44dea673e9SRodney W. Grimes.Op Ar port#
45dea673e9SRodney W. Grimes.Sh DESCRIPTION
46490d5836SPhilippe CharnierThe
47490d5836SPhilippe Charnier.Nm
48490d5836SPhilippe Charnierutility
49dea673e9SRodney W. Grimesis the line printer daemon (spool area handler) and is normally invoked
50dea673e9SRodney W. Grimesat boot time from the
51dea673e9SRodney W. Grimes.Xr rc 8
52dea673e9SRodney W. Grimesfile.  It makes a single pass through the
53dea673e9SRodney W. Grimes.Xr printcap 5
54dea673e9SRodney W. Grimesfile to find out about the existing printers and
55f2e366a1SSheldon Hearnprints any files left after a crash.
56f2e366a1SSheldon HearnIt then uses the system calls
57dea673e9SRodney W. Grimes.Xr listen 2
58dea673e9SRodney W. Grimesand
59dea673e9SRodney W. Grimes.Xr accept 2
60dea673e9SRodney W. Grimesto receive requests to print files in the queue,
61dea673e9SRodney W. Grimestransfer files to the spooling area, display the queue,
62dea673e9SRodney W. Grimesor remove jobs from the queue.  In each case, it forks a child to handle
63dea673e9SRodney W. Grimesthe request so the parent can continue to listen for more requests.
64dea673e9SRodney W. Grimes.Pp
65dea673e9SRodney W. GrimesAvailable options:
66dea673e9SRodney W. Grimes.Bl -tag -width Ds
676ddb63caSGarance A Drosehn.It Fl c
686ddb63caSGarance A DrosehnBy default, if some remote host has a connection error while trying to
696ddb63caSGarance A Drosehnsend a print request to
706ddb63caSGarance A Drosehn.Nm
716ddb63caSGarance A Drosehnon a local host,
726ddb63caSGarance A Drosehn.Nm
736ddb63caSGarance A Drosehnwill only send error message to that remote host.
746ddb63caSGarance A DrosehnThe
756ddb63caSGarance A Drosehn.Fl c
766ddb63caSGarance A Drosehnflag causes
776ddb63caSGarance A Drosehn.Nm
786ddb63caSGarance A Drosehnto also log all of those connection errors via
796ddb63caSGarance A Drosehn.Xr syslog 3 .
8036d0e2a3SJoerg Wunsch.It Fl d
8136d0e2a3SJoerg WunschTurn on
8236d0e2a3SJoerg Wunsch.Dv SO_DEBUG
8336d0e2a3SJoerg Wunschon the Internet listening socket (see
8436d0e2a3SJoerg Wunsch.Xr setsockopt 2 ) .
85dea673e9SRodney W. Grimes.It Fl l
86dea673e9SRodney W. GrimesThe
87dea673e9SRodney W. Grimes.Fl l
88dea673e9SRodney W. Grimesflag causes
899b3fe531SPhilippe Charnier.Nm
90f2e366a1SSheldon Hearnto log valid requests received from the network.
91f2e366a1SSheldon HearnThis can be useful
92dea673e9SRodney W. Grimesfor debugging purposes.
93ba901a11SSheldon Hearn.It Fl p
94ba901a11SSheldon HearnThe
95ba901a11SSheldon Hearn.Fl p
96c7e56d32SGarance A Drosehnflag is a synonym for the
97c7e56d32SGarance A Drosehn.Fl s
98c7e56d32SGarance A Drosehnflag.
99c7e56d32SGarance A DrosehnIt is being depreciated, and may be removed in a
100c7e56d32SGarance A Drosehnfuture version of
101c7e56d32SGarance A Drosehn.Nm .
102c7e56d32SGarance A Drosehn.It Fl s
103c7e56d32SGarance A DrosehnThe
104c7e56d32SGarance A Drosehn.Fl s
105c7e56d32SGarance A Drosehn(secure) flag causes
106ba901a11SSheldon Hearn.Nm
107ba901a11SSheldon Hearnnot to open an Internet listening socket.
1086ddb63caSGarance A DrosehnThis means that
1096ddb63caSGarance A Drosehn.Nm
1106ddb63caSGarance A Drosehnwill not accept any connections from any remote
1116ddb63caSGarance A Drosehnhosts, although it will still accept print requests
1126ddb63caSGarance A Drosehnfrom all local users.
113605d466bSGarance A Drosehn.It Fl W
1146ddb63caSGarance A DrosehnBy default, the
1156ddb63caSGarance A Drosehn.Nm
1166ddb63caSGarance A Drosehndaemon will only accept connections which originate
1176ddb63caSGarance A Drosehnfrom a reserved-port (<1024) on the remote host.
1186ddb63caSGarance A DrosehnThe
119605d466bSGarance A Drosehn.Fl W
1206ddb63caSGarance A Drosehnflag causes
1216ddb63caSGarance A Drosehn.Nm
1226ddb63caSGarance A Drosehnto accept connections coming from any port.
1236ddb63caSGarance A DrosehnThis is can be useful when you want to accept print jobs
1246ddb63caSGarance A Drosehnfrom certain implementations of lpr written for Windows.
12508829865SHajimu UMEMOTO.It Fl 4
12608829865SHajimu UMEMOTOInet only.
12708829865SHajimu UMEMOTO.It Fl 6
12808829865SHajimu UMEMOTOInet6 only.
12908829865SHajimu UMEMOTO.It Fl 46
13008829865SHajimu UMEMOTOInet and inet6 (default).
131dea673e9SRodney W. Grimes.It Ar "port#"
132dea673e9SRodney W. GrimesThe Internet port number used to rendezvous
133dea673e9SRodney W. Grimeswith other processes is normally obtained with
134dea673e9SRodney W. Grimes.Xr getservbyname 3
135dea673e9SRodney W. Grimesbut can be changed with the
136dea673e9SRodney W. Grimes.Ar port#
137dea673e9SRodney W. Grimesargument.
138dea673e9SRodney W. Grimes.El
139dea673e9SRodney W. Grimes.Pp
140f2e366a1SSheldon HearnAccess control is provided by two means.
141f2e366a1SSheldon HearnFirst, all requests must come from
142dea673e9SRodney W. Grimesone of the machines listed in the file
143dea673e9SRodney W. Grimes.Pa /etc/hosts.equiv
144dea673e9SRodney W. Grimesor
145dea673e9SRodney W. Grimes.Pa /etc/hosts.lpd .
146dea673e9SRodney W. GrimesSecond, if the
147dea673e9SRodney W. Grimes.Li rs
148dea673e9SRodney W. Grimescapability is specified in the
1498b5c4af3SRuslan Ermilov.Xr printcap 5
150dea673e9SRodney W. Grimesentry for the printer being accessed,
151dea673e9SRodney W. Grimes.Em lpr
152dea673e9SRodney W. Grimesrequests will only be honored for those users with accounts on the
153dea673e9SRodney W. Grimesmachine with the printer.
154dea673e9SRodney W. Grimes.Pp
155dea673e9SRodney W. GrimesThe file
156dea673e9SRodney W. Grimes.Em minfree
157dea673e9SRodney W. Grimesin each spool directory contains the number of disk blocks to leave free
158dea673e9SRodney W. Grimesso that the line printer queue won't completely fill the disk.
159dea673e9SRodney W. GrimesThe
160dea673e9SRodney W. Grimes.Em minfree
161dea673e9SRodney W. Grimesfile can be edited with your favorite text editor.
162dea673e9SRodney W. Grimes.Pp
163dea673e9SRodney W. GrimesThe daemon begins processing files
164dea673e9SRodney W. Grimesafter it has successfully set the lock for exclusive
165dea673e9SRodney W. Grimesaccess (described a bit later),
166dea673e9SRodney W. Grimesand scans the spool directory
167dea673e9SRodney W. Grimesfor files beginning with
168dea673e9SRodney W. Grimes.Em cf .
169dea673e9SRodney W. GrimesLines in each
170dea673e9SRodney W. Grimes.Em cf
171dea673e9SRodney W. Grimesfile specify files to be printed or non-printing actions to be
172dea673e9SRodney W. Grimesperformed.  Each such line begins with a key character
173dea673e9SRodney W. Grimesto specify what to do with the remainder of the line.
174dea673e9SRodney W. Grimes.Bl -tag -width Ds
175dea673e9SRodney W. Grimes.It J
176dea673e9SRodney W. GrimesJob Name.  String to be used for the job name on the burst page.
177dea673e9SRodney W. Grimes.It C
178dea673e9SRodney W. GrimesClassification.  String to be used for the classification line
179dea673e9SRodney W. Grimeson the burst page.
180dea673e9SRodney W. Grimes.It L
181dea673e9SRodney W. GrimesLiteral.  The line contains identification info from
182dea673e9SRodney W. Grimesthe password file and causes the banner page to be printed.
183dea673e9SRodney W. Grimes.It T
184dea673e9SRodney W. GrimesTitle.  String to be used as the title for
185dea673e9SRodney W. Grimes.Xr pr 1 .
186dea673e9SRodney W. Grimes.It H
187dea673e9SRodney W. GrimesHost Name.  Name of the machine where
188dea673e9SRodney W. Grimes.Xr lpr
189dea673e9SRodney W. Grimeswas invoked.
190dea673e9SRodney W. Grimes.It P
191dea673e9SRodney W. GrimesPerson.  Login name of the person who invoked
192dea673e9SRodney W. Grimes.Xr lpr .
193dea673e9SRodney W. GrimesThis is used to verify ownership by
194dea673e9SRodney W. Grimes.Xr lprm .
195dea673e9SRodney W. Grimes.It M
196dea673e9SRodney W. GrimesSend mail to the specified user when the current print job completes.
197dea673e9SRodney W. Grimes.It f
198dea673e9SRodney W. GrimesFormatted File.  Name of a file to print which is already formatted.
199dea673e9SRodney W. Grimes.It l
200dea673e9SRodney W. GrimesLike ``f'' but passes control characters and does not make page breaks.
201dea673e9SRodney W. Grimes.It p
202dea673e9SRodney W. GrimesName of a file to print using
203dea673e9SRodney W. Grimes.Xr pr 1
204dea673e9SRodney W. Grimesas a filter.
205dea673e9SRodney W. Grimes.It t
206dea673e9SRodney W. GrimesTroff File.  The file contains
207dea673e9SRodney W. Grimes.Xr troff 1
208dea673e9SRodney W. Grimesoutput (cat phototypesetter commands).
209dea673e9SRodney W. Grimes.It n
210dea673e9SRodney W. GrimesDitroff File.  The file contains device independent troff
211dea673e9SRodney W. Grimesoutput.
212dea673e9SRodney W. Grimes.It r
213dea673e9SRodney W. GrimesDVI File.  The file contains
214dea673e9SRodney W. Grimes.Tn Tex l
215dea673e9SRodney W. Grimesoutput
216dea673e9SRodney W. GrimesDVI format from Standford.
217dea673e9SRodney W. Grimes.It g
218dea673e9SRodney W. GrimesGraph File.  The file contains data produced by
219dea673e9SRodney W. Grimes.Xr plot 3 .
220dea673e9SRodney W. Grimes.It c
221f2e366a1SSheldon HearnCifplot File.
222f2e366a1SSheldon HearnThe file contains data produced by
223dea673e9SRodney W. Grimes.Em cifplot .
224dea673e9SRodney W. Grimes.It v
225dea673e9SRodney W. GrimesThe file contains a raster image.
226dea673e9SRodney W. Grimes.It r
227dea673e9SRodney W. GrimesThe file contains text data with
228dea673e9SRodney W. GrimesFORTRAN carriage control characters.
229dea673e9SRodney W. Grimes.It \&1
230dea673e9SRodney W. GrimesTroff Font R. Name of the font file to use instead of the default.
231dea673e9SRodney W. Grimes.It \&2
232dea673e9SRodney W. GrimesTroff Font I. Name of the font file to use instead of the default.
233dea673e9SRodney W. Grimes.It \&3
234dea673e9SRodney W. GrimesTroff Font B. Name of the font file to use instead of the default.
235dea673e9SRodney W. Grimes.It \&4
236dea673e9SRodney W. GrimesTroff Font S. Name of the font file to use instead of the default.
237dea673e9SRodney W. Grimes.It W
238f2e366a1SSheldon HearnWidth.
239f2e366a1SSheldon HearnChanges the page width (in characters) used by
240dea673e9SRodney W. Grimes.Xr pr 1
241dea673e9SRodney W. Grimesand the text filters.
242dea673e9SRodney W. Grimes.It I
243c6d6e772SAlexey ZelkinIndent.  The number of characters to indent the output by (in ASCII).
244dea673e9SRodney W. Grimes.It U
245dea673e9SRodney W. GrimesUnlink.  Name of file to remove upon completion of printing.
246dea673e9SRodney W. Grimes.It N
247dea673e9SRodney W. GrimesFile name.  The name of the file which is being printed, or a blank
248dea673e9SRodney W. Grimesfor the standard input (when
249dea673e9SRodney W. Grimes.Xr lpr
250dea673e9SRodney W. Grimesis invoked in a pipeline).
251d3d56c3dSAndrey A. Chernov.It Z
252d3d56c3dSAndrey A. ChernovLocale.  String to be used as the locale for
253d3d56c3dSAndrey A. Chernov.Xr pr 1 .
254dea673e9SRodney W. Grimes.El
255dea673e9SRodney W. Grimes.Pp
256dea673e9SRodney W. GrimesIf a file cannot be opened, a message will be logged via
257dea673e9SRodney W. Grimes.Xr syslog 3
258dea673e9SRodney W. Grimesusing the
259dea673e9SRodney W. Grimes.Em LOG_LPR
260dea673e9SRodney W. Grimesfacility.
261490d5836SPhilippe CharnierThe
262490d5836SPhilippe Charnier.Nm
263490d5836SPhilippe Charnierutility will try up to 20 times
264dea673e9SRodney W. Grimesto reopen a file it expects to be there, after which it will
265dea673e9SRodney W. Grimesskip the file to be printed.
266dea673e9SRodney W. Grimes.Pp
267490d5836SPhilippe CharnierThe
268490d5836SPhilippe Charnier.Nm
269490d5836SPhilippe Charnierutility uses
270dea673e9SRodney W. Grimes.Xr flock 2
271dea673e9SRodney W. Grimesto provide exclusive access to the lock file and to prevent multiple
272dea673e9SRodney W. Grimesdaemons from becoming active simultaneously.  If the daemon should be killed
273dea673e9SRodney W. Grimesor die unexpectedly, the lock file need not be removed.
274dea673e9SRodney W. GrimesThe lock file is kept in a readable
275dea673e9SRodney W. Grimes.Tn ASCII
276dea673e9SRodney W. Grimesform
277dea673e9SRodney W. Grimesand contains two lines.
278dea673e9SRodney W. GrimesThe first is the process id of the daemon and the second is the control
279dea673e9SRodney W. Grimesfile name of the current job being printed.  The second line is updated to
280dea673e9SRodney W. Grimesreflect the current status of
2819b3fe531SPhilippe Charnier.Nm
282dea673e9SRodney W. Grimesfor the programs
283dea673e9SRodney W. Grimes.Xr lpq 1
284dea673e9SRodney W. Grimesand
285dea673e9SRodney W. Grimes.Xr lprm 1 .
286dea673e9SRodney W. Grimes.Sh FILES
287dea673e9SRodney W. Grimes.Bl -tag -width "/var/spool/*/minfree" -compact
288dea673e9SRodney W. Grimes.It Pa /etc/printcap
289dea673e9SRodney W. Grimesprinter description file
290dea673e9SRodney W. Grimes.It Pa /var/spool/*
291dea673e9SRodney W. Grimesspool directories
292dea673e9SRodney W. Grimes.It Pa /var/spool/*/minfree
293dea673e9SRodney W. Grimesminimum free space to leave
294dea673e9SRodney W. Grimes.It Pa /dev/lp*
295dea673e9SRodney W. Grimesline printer devices
29686c7d890SAndreas Schulz.It Pa /var/run/printer
297dea673e9SRodney W. Grimessocket for local requests
298dea673e9SRodney W. Grimes.It Pa /etc/hosts.equiv
299dea673e9SRodney W. Grimeslists machine names allowed printer access
300dea673e9SRodney W. Grimes.It Pa /etc/hosts.lpd
301dea673e9SRodney W. Grimeslists machine names allowed printer access,
302dea673e9SRodney W. Grimesbut not under same administrative control.
303dea673e9SRodney W. Grimes.El
304dea673e9SRodney W. Grimes.Sh SEE ALSO
305dea673e9SRodney W. Grimes.Xr lpq 1 ,
306bfd34a4aSWolfram Schneider.Xr lpr 1 ,
307dea673e9SRodney W. Grimes.Xr lprm 1 ,
30836d0e2a3SJoerg Wunsch.Xr setsockopt 2 ,
309dea673e9SRodney W. Grimes.Xr syslog 3 ,
310bfd34a4aSWolfram Schneider.Xr hosts.lpd 5 ,
31178b0b234SMike Pritchard.Xr printcap 5 ,
3124d39e5f9SGarance A Drosehn.Xr chkprintcap 8 ,
31378b0b234SMike Pritchard.Xr lpc 8 ,
31478b0b234SMike Pritchard.Xr pac 8
315dea673e9SRodney W. Grimes.Rs
316dea673e9SRodney W. Grimes.%T "4.2 BSD Line Printer Spooler Manual"
317dea673e9SRodney W. Grimes.Re
318dea673e9SRodney W. Grimes.Sh HISTORY
319dea673e9SRodney W. GrimesAn
320dea673e9SRodney W. Grimes.Nm
321dea673e9SRodney W. Grimesdaemon appeared in Version 6 AT&T UNIX.
322