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: src/usr.sbin/lpr/lpd/lpd.8,v 1.14.2.13 2002/12/29 16:35:42 schweikh Exp $ 34.\" $DragonFly: src/usr.sbin/lpr/lpd/lpd.8,v 1.5 2007/05/12 21:22:10 swildner Exp $ 35.\" 36.Dd June 6, 2001 37.Dt LPD 8 38.Os 39.Sh NAME 40.Nm lpd 41.Nd line printer spooler daemon 42.Sh SYNOPSIS 43.Nm 44.Op Fl cdlpsW46 45.Op Ar port# 46.Sh DESCRIPTION 47The 48.Nm 49utility 50is the line printer daemon (spool area handler) and is normally invoked 51at boot time from the 52.Xr rc 8 53file. It makes a single pass through the 54.Xr printcap 5 55file to find out about the existing printers and 56prints any files left after a crash. 57It then uses the system calls 58.Xr listen 2 59and 60.Xr accept 2 61to receive requests to print files in the queue, 62transfer files to the spooling area, display the queue, 63or remove jobs from the queue. In each case, it forks a child to handle 64the request so the parent can continue to listen for more requests. 65.Pp 66Available options: 67.Bl -tag -width Ds 68.It Fl c 69By default, if some remote host has a connection error while trying to 70send a print request to 71.Nm 72on a local host, 73.Nm 74will only send error message to that remote host. 75The 76.Fl c 77flag causes 78.Nm 79to also log all of those connection errors via 80.Xr syslog 3 . 81.It Fl d 82Turn on 83.Dv SO_DEBUG 84on the Internet listening socket (see 85.Xr setsockopt 2 ) . 86.It Fl l 87The 88.Fl l 89flag causes 90.Nm 91to log valid requests received from the network. 92This can be useful 93for debugging purposes. 94.It Fl p 95The 96.Fl p 97flag is a synonym for the 98.Fl s 99flag. 100It is being deprecated, and may be removed in a 101future version of 102.Nm . 103.It Fl s 104The 105.Fl s 106(secure) flag causes 107.Nm 108not to open an Internet listening socket. 109This means that 110.Nm 111will not accept any connections from any remote 112hosts, although it will still accept print requests 113from all local users. 114.It Fl W 115By default, the 116.Nm 117daemon will only accept connections which originate 118from a reserved-port (<1024) on the remote host. 119The 120.Fl W 121flag causes 122.Nm 123to accept connections coming from any port. 124This is can be useful when you want to accept print jobs 125from certain implementations of lpr written for Windows. 126.It Fl 4 127Inet only. 128.It Fl 6 129Inet6 only. 130.It Fl 46 131Inet and inet6 (default). 132.It Ar "port#" 133The Internet port number used to rendezvous 134with other processes is normally obtained with 135.Xr getservbyname 3 136but can be changed with the 137.Ar port# 138argument. 139.El 140.Pp 141Access control is provided by two means. 142First, all requests must come from 143one of the machines listed in the file 144.Pa /etc/hosts.equiv 145or 146.Pa /etc/hosts.lpd . 147Second, if the 148.Li rs 149capability is specified in the 150.Xr printcap 5 151entry for the printer being accessed, 152.Em lpr 153requests will only be honored for those users with accounts on the 154machine with the printer. 155.Pp 156The file 157.Em minfree 158in each spool directory contains the number of disk blocks to leave free 159so that the line printer queue won't completely fill the disk. 160The 161.Em minfree 162file can be edited with your favorite text editor. 163.Pp 164The daemon begins processing files 165after it has successfully set the lock for exclusive 166access (described a bit later), 167and scans the spool directory 168for files beginning with 169.Em cf . 170Lines in each 171.Em cf 172file specify files to be printed or non-printing actions to be 173performed. Each such line begins with a key character 174to specify what to do with the remainder of the line. 175.Bl -tag -width Ds 176.It J 177Job Name. String to be used for the job name on the burst page. 178.It C 179Classification. String to be used for the classification line 180on the burst page. 181.It L 182Literal. The line contains identification info from 183the password file and causes the banner page to be printed. 184.It T 185Title. String to be used as the title for 186.Xr pr 1 . 187.It H 188Host Name. Name of the machine where 189.Xr lpr 1 190was invoked. 191.It P 192Person. Login name of the person who invoked 193.Xr lpr 1 . 194This is used to verify ownership by 195.Xr lprm 1 . 196.It M 197Send mail to the specified user when the current print job completes. 198.It f 199Formatted File. Name of a file to print which is already formatted. 200.It l 201Like ``f'' but passes control characters and does not make page breaks. 202.It p 203Name of a file to print using 204.Xr pr 1 205as a filter. 206.It t 207Troff File. The file contains 208.Xr troff 1 209output (cat phototypesetter commands). 210.It n 211Ditroff File. The file contains device independent troff 212output. 213.It r 214DVI File. The file contains 215.Tn Tex l 216output 217DVI format from Stanford. 218.It g 219Graph File. The file contains data produced by 220.Xr plot 3 . 221.It c 222Cifplot File. 223The file contains data produced by 224.Em cifplot . 225.It v 226The file contains a raster image. 227.It r 228The file contains text data with 229FORTRAN carriage control characters. 230.It \&1 231Troff Font R. Name of the font file to use instead of the default. 232.It \&2 233Troff Font I. Name of the font file to use instead of the default. 234.It \&3 235Troff Font B. Name of the font file to use instead of the default. 236.It \&4 237Troff Font S. Name of the font file to use instead of the default. 238.It W 239Width. 240Changes the page width (in characters) used by 241.Xr pr 1 242and the text filters. 243.It I 244Indent. The number of characters to indent the output by (in ASCII). 245.It U 246Unlink. Name of file to remove upon completion of printing. 247.It N 248File name. The name of the file which is being printed, or a blank 249for the standard input (when 250.Xr lpr 1 251is invoked in a pipeline). 252.It Z 253Locale. String to be used as the locale for 254.Xr pr 1 . 255.El 256.Pp 257If a file cannot be opened, a message will be logged via 258.Xr syslog 3 259using the 260.Em LOG_LPR 261facility. 262The 263.Nm 264utility will try up to 20 times 265to reopen a file it expects to be there, after which it will 266skip the file to be printed. 267.Pp 268The 269.Nm 270utility uses 271.Xr flock 2 272to provide exclusive access to the lock file and to prevent multiple 273daemons from becoming active simultaneously. If the daemon should be killed 274or die unexpectedly, the lock file need not be removed. 275The lock file is kept in a readable 276.Tn ASCII 277form 278and contains two lines. 279The first is the process id of the daemon and the second is the control 280file name of the current job being printed. The second line is updated to 281reflect the current status of 282.Nm 283for the programs 284.Xr lpq 1 285and 286.Xr lprm 1 . 287.Sh FILES 288.Bl -tag -width "/var/spool/*/minfree" -compact 289.It Pa /etc/printcap 290printer description file 291.It Pa /var/spool/* 292spool directories 293.It Pa /var/spool/*/minfree 294minimum free space to leave 295.It Pa /dev/lp* 296line printer devices 297.It Pa /var/run/printer 298socket for local requests 299.It Pa /etc/hosts.equiv 300lists machine names allowed printer access 301.It Pa /etc/hosts.lpd 302lists machine names allowed printer access, 303but not under same administrative control. 304.El 305.Sh SEE ALSO 306.Xr lpq 1 , 307.Xr lpr 1 , 308.Xr lprm 1 , 309.Xr setsockopt 2 , 310.Xr syslog 3 , 311.Xr hosts.lpd 5 , 312.Xr printcap 5 , 313.Xr chkprintcap 8 , 314.Xr lpc 8 , 315.Xr pac 8 316.Rs 317.%T "4.2 BSD Line Printer Spooler Manual" 318.Re 319.Sh HISTORY 320An 321.Nm 322daemon appeared in 323.At v6 . 324