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