xref: /csrg-svn/usr.sbin/lpr/lpd/lpd.8 (revision 47469)
1*47469Scael.\" Copyright (c) 1983, 1991 The Regents of the University of California.
235749Sbostic.\" All rights reserved.
318984Smckusick.\"
443831Strent.\" %sccs.include.redist.man%
518984Smckusick.\"
6*47469Scael.\"     @(#)lpd.8	6.6 (Berkeley) 03/16/91
735749Sbostic.\"
8*47469Scael.Dd
9*47469Scael.Dt LPD 8
10*47469Scael.Os BSD 4.2
11*47469Scael.Sh NAME
12*47469Scael.Nm lpd
13*47469Scael.Nd line printer spooler daemon
14*47469Scael.Sh SYNOPSIS
15*47469Scael.Nm lpd
16*47469Scael.Op Fl l
17*47469Scael.Op Ar port#
18*47469Scael.Sh DESCRIPTION
19*47469Scael.Nm Lpd
2018984Smckusickis the line printer daemon (spool area handler) and is normally invoked
2118984Smckusickat boot time from the
22*47469Scael.Xr rc 8
2318984Smckusickfile.  It makes a single pass through the
24*47469Scael.Xr printcap 5
2518984Smckusickfile to find out about the existing printers and
2618984Smckusickprints any files left after a crash. It then uses the system calls
27*47469Scael.Xr listen 2
2818984Smckusickand
29*47469Scael.Xr accept 2
3018984Smckusickto receive requests to print files in the queue,
3118984Smckusicktransfer files to the spooling area, display the queue,
3218984Smckusickor remove jobs from the queue.  In each case, it forks a child to handle
3318984Smckusickthe request so the parent can continue to listen for more requests.
34*47469Scael.Pp
35*47469ScaelAvailable options:
36*47469Scael.Bl -tag -width Ds
37*47469Scael.It Fl l
38*47469ScaelThe
39*47469Scael.Fl l
40*47469Scaelflag causes
41*47469Scael.Nm lpd
42*47469Scaelto log valid requests received from the network. This can be useful
43*47469Scaelfor debugging purposes.
44*47469Scael.It Ar "port#"
4518984SmckusickThe Internet port number used to rendezvous
4618984Smckusickwith other processes is normally obtained with
47*47469Scael.Xr getservbyname 3
4818984Smckusickbut can be changed with the
49*47469Scael.Ar port#
5025492Sericargument.
51*47469Scael.El
52*47469Scael.Pp
53*47469ScaelAccess control is provided by two means. First, all requests must come from
5418984Smckusickone of the machines listed in the file
55*47469Scael.Pa /etc/hosts.equiv
5618985Smckusickor
57*47469Scael.Pa /etc/hosts.lpd .
58*47469ScaelSecond, if the
59*47469Scael.Li rs
60*47469Scaelcapability is specified in the
61*47469Scael.Xr printcap
6218984Smckusickentry for the printer being accessed,
63*47469Scael.Em lpr
6418984Smckusickrequests will only be honored for those users with accounts on the
6518984Smckusickmachine with the printer.
66*47469Scael.Pp
6718984SmckusickThe file
68*47469Scael.Em minfree
6918985Smckusickin each spool directory contains the number of disk blocks to leave free
7018985Smckusickso that the line printer queue won't completely fill the disk.
7118985SmckusickThe
72*47469Scael.Em minfree
7318985Smckusickfile can be edited with your favorite text editor.
74*47469Scael.Pp
75*47469ScaelThe daemon begins processing files
76*47469Scaelafter it has successfully set the lock for exclusive
77*47469Scaelaccess (descibed a bit later),
78*47469Scaeland scans the spool directory
7918984Smckusickfor files beginning with
80*47469Scael.Em cf .
8118984SmckusickLines in each
82*47469Scael.Em cf
8318984Smckusickfile specify files to be printed or non-printing actions to be
8418984Smckusickperformed.  Each such line begins with a key character
8518984Smckusickto specify what to do with the remainder of the line.
86*47469Scael.Bl -tag -width Ds
87*47469Scael.It J
8818984SmckusickJob Name.  String to be used for the job name on the burst page.
89*47469Scael.It C
9018984SmckusickClassification.  String to be used for the classification line
9118984Smckusickon the burst page.
92*47469Scael.It L
9318984SmckusickLiteral.  The line contains identification info from
9418984Smckusickthe password file and causes the banner page to be printed.
95*47469Scael.It T
9618984SmckusickTitle.  String to be used as the title for
97*47469Scael.Xr pr 1 .
98*47469Scael.It H
9918984SmckusickHost Name.  Name of the machine where
100*47469Scael.Xr lpr
10118984Smckusickwas invoked.
102*47469Scael.It P
10318984SmckusickPerson.  Login name of the person who invoked
104*47469Scael.Xr lpr .
10518984SmckusickThis is used to verify ownership by
106*47469Scael.Xr lprm .
107*47469Scael.It M
10818984SmckusickSend mail to the specified user when the current print job completes.
109*47469Scael.It f
11018984SmckusickFormatted File.  Name of a file to print which is already formatted.
111*47469Scael.It l
11218984SmckusickLike ``f'' but passes control characters and does not make page breaks.
113*47469Scael.It p
11418984SmckusickName of a file to print using
115*47469Scael.Xr pr 1
11618984Smckusickas a filter.
117*47469Scael.It t
11818984SmckusickTroff File.  The file contains
119*47469Scael.Xr troff 1
12018984Smckusickoutput (cat phototypesetter commands).
121*47469Scael.It n
12218985SmckusickDitroff File.  The file contains device independent troff
12318985Smckusickoutput.
124*47469Scael.It r
12518984SmckusickDVI File.  The file contains
126*47469Scael.Tn Tex l
127*47469Scaeloutput
128*47469ScaelDVI format from Standford).
129*47469Scael.It g
13018984SmckusickGraph File.  The file contains data produced by
131*47469Scael.Xr plot 3 .
132*47469Scael.It c
13318984SmckusickCifplot File. The file contains data produced by
134*47469Scael.Em cifplot .
135*47469Scael.It v
13618984SmckusickThe file contains a raster image.
137*47469Scael.It r
138*47469ScaelThe file contains text data with
139*47469ScaelFORTRAN carriage control characters.
140*47469Scael.It \&1
14118984SmckusickTroff Font R. Name of the font file to use instead of the default.
142*47469Scael.It \&2
14318984SmckusickTroff Font I. Name of the font file to use instead of the default.
144*47469Scael.It \&3
14518984SmckusickTroff Font B. Name of the font file to use instead of the default.
146*47469Scael.It \&4
14718984SmckusickTroff Font S. Name of the font file to use instead of the default.
148*47469Scael.It W
14918984SmckusickWidth. Changes the page width (in characters) used by
150*47469Scael.Xr pr 1
15118984Smckusickand the text filters.
152*47469Scael.It I
15318984SmckusickIndent.  The number of characters to indent the output by (in ascii).
154*47469Scael.It U
15518984SmckusickUnlink.  Name of file to remove upon completion of printing.
156*47469Scael.It N
15718984SmckusickFile name.  The name of the file which is being printed, or a blank
15818984Smckusickfor the standard input (when
159*47469Scael.Xr lpr
16018984Smckusickis invoked in a pipeline).
161*47469Scael.El
162*47469Scael.Pp
16325492SericIf a file can not be opened, a message will be logged via
164*47469Scael.Xr syslog 3
16525492Sericusing the
166*47469Scael.Em LOG_LPR
16725492Sericfacility.
168*47469Scael.Nm Lpd
16918984Smckusickwill try up to 20 times
17018984Smckusickto reopen a file it expects to be there, after which it will
17118984Smckusickskip the file to be printed.
172*47469Scael.Pp
173*47469Scael.Nm Lpd
17418984Smckusickuses
175*47469Scael.Xr flock 2
17618984Smckusickto provide exclusive access to the lock file and to prevent multiple
17718984Smckusickdeamons from becoming active simultaneously.  If the daemon should be killed
17818984Smckusickor die unexpectedly, the lock file need not be removed.
179*47469ScaelThe lock file is kept in a readable
180*47469Scael.Tn ASCII
181*47469Scaelform
18218984Smckusickand contains two lines.
18318984SmckusickThe first is the process id of the daemon and the second is the control
18418984Smckusickfile name of the current job being printed.  The second line is updated to
18518984Smckusickreflect the current status of
186*47469Scael.Nm lpd
18718984Smckusickfor the programs
188*47469Scael.Xr lpq 1
18918984Smckusickand
190*47469Scael.Xr lprm 1 .
191*47469Scael.Sh FILES
192*47469Scael.Bl -tag -width "/var/spool/*/minfree" -compact
193*47469Scael.It Pa /etc/printcap
194*47469Scaelprinter description file
195*47469Scael.It Pa /var/spool/*
196*47469Scaelspool directories
197*47469Scael.It Pa /var/spool/*/minfree
198*47469Scaelminimum free space to leave
199*47469Scael.It Pa /dev/lp*
200*47469Scaelline printer devices
201*47469Scael.It Pa /dev/printer
202*47469Scaelsocket for local requests
203*47469Scael.It Pa /etc/hosts.equiv
204*47469Scaellists machine names allowed printer access
205*47469Scael.It Pa /etc/hosts.lpd
206*47469Scaellists machine names allowed printer access,
207*47469Scaelbut not under same administrative control.
208*47469Scael.El
209*47469Scael.Sh SEE ALSO
210*47469Scael.Xr lpc 8 ,
211*47469Scael.Xr pac 1 ,
212*47469Scael.Xr lpr 1 ,
213*47469Scael.Xr lpq 1 ,
214*47469Scael.Xr lprm 1 ,
215*47469Scael.Xr syslog 3 ,
216*47469Scael.Xr printcap 5
217*47469Scael.Rs
218*47469Scael.%T "4.2 BSD Line Printer Spooler Manual"
219*47469Scael.Re
220*47469Scael.Sh HISTORY
221*47469ScaelAn
222*47469Scael.Nm
223*47469Scaeldaemon appeared in Version 6 AT&T UNIX.
224