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