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