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