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.\" @(#)printcap.5 8.2 (Berkeley) 12/11/93 33.\" $FreeBSD$ 34.\" 35.Dd October 11, 2000 36.Dt PRINTCAP 5 37.Os 38.Sh NAME 39.Nm printcap 40.Nd printer capability data base 41.Sh SYNOPSIS 42.Nm 43.Sh DESCRIPTION 44The 45.Nm Printcap 46function 47is a simplified version of the 48.Xr termcap 5 49data base 50used to describe line printers. The spooling system accesses the 51.Nm 52file every time it is used, allowing dynamic 53addition and deletion of printers. Each entry in the data base 54is used to describe one printer. This data base may not be 55substituted for, as is possible for 56.Xr termcap 5 , 57because it may allow accounting to be bypassed. 58.Pp 59The default printer is normally 60.Em lp , 61though the environment variable 62.Ev PRINTER 63may be used to override this. Each spooling utility supports an option, 64.Fl P Ar printer , 65to allow explicit naming of a destination printer. 66.Pp 67Refer to the 68.%T "4.3 BSD Line Printer Spooler Manual" 69for a complete discussion on how to setup the database for a given printer. 70.Sh CAPABILITIES 71Refer to 72.Xr termcap 5 73for a description of the file layout. 74.Bl -column Namexxx Typexx "/var/spool/lpdxxxxx" 75.Sy "Name Type Default Description 76.It "af str" Ta Dv NULL Ta No "name of accounting file" 77.It "br num none if lp is a tty, set the baud rate" 78.Xr ( ioctl 2 79call) 80.It "cf str" Ta Dv NULL Ta No "cifplot data filter" 81.It "ct num 120 TCP connection timeout in seconds" 82.It "df str" Ta Dv NULL Ta No "tex data filter" 83.Tn ( DVI 84format) 85.It "ff str" Ta So Li \ef Sc Ta No "string to send for a form feed" 86.It "fo bool false print a form feed when device is opened" 87.It "gf str" Ta Dv NULL Ta No "graph data filter" 88.Xr ( plot 3 89format 90.It "hl bool false print the burst header page last" 91.It "ic bool false driver supports (non standard) ioctl to indent printout" 92.It "if str" Ta Dv NULL Ta No "name of text filter which does accounting" 93.It "lf str" Ta Pa /dev/console Ta No "error logging file name" 94.It "lo str" Ta Pa lock Ta No "name of lock file" 95.It "lp str" Ta Pa /dev/lp Ta No "device name to open for output" 96.It "mc num 0 maximum number of copies which can be requested on" 97.Xr lpr 1 , 98zero = unlimited 99.It "ms str" Ta Dv NULL Ta No "if lp is a tty, a comma-separated," 100.Xr stty 1 Ns -like 101list describing the tty modes 102.It "mx num 0 maximum file size (in" 103.Dv BUFSIZ 104blocks), zero = unlimited 105.It "nd str" Ta Dv NULL Ta No "next directory for list of queues (unimplemented)" 106.It "nf str" Ta Dv NULL Ta No "ditroff data filter (device independent troff)" 107.It "of str" Ta Dv NULL Ta No "name of output filtering program" 108.It "pc num 200 price per foot or page in hundredths of cents" 109.It "pl num 66 page length (in lines)" 110.It "pw num 132 page width (in characters)" 111.It "px num 0 page width in pixels (horizontal)" 112.It "py num 0 page length in pixels (vertical)" 113.It "rc bool false when sending to a remote host, resend copies (see below)" 114.It "rf str" Ta Dv NULL Ta No "filter for printing" 115.Tn FORTRAN 116style text files 117.It "rg str" Ta Dv NULL Ta No "restricted group. Only members of group allowed access" 118.It "rm str" Ta Dv NULL Ta No "machine name for remote printer" 119.It "rp str" Ta Pa lp Ta No "remote printer name argument" 120.It "rs bool false restrict remote users to those with local accounts" 121.It "rw bool false open the printer device for reading and writing" 122.It "sb bool false short banner (one line only)" 123.It "sc bool false suppress multiple copies" 124.It "sd str" Ta Pa /var/spool/lpd Ta No "spool directory" 125.It "sf bool false suppress form feeds" 126.It "sh bool false suppress printing of burst page header" 127.It "sr str" Ta Dv NULL Ta No "file name to hold statistics of each datafile as it is received" 128.It "ss str" Ta Dv NULL Ta No "file name to hold statistics of each datafile as it is sent" 129.It "st str" Ta Pa status Ta No "status file name" 130.It "tf str" Ta Dv NULL Ta No "troff data filter (cat phototypesetter)" 131.It "tr str" Ta Dv NULL Ta No "trailer string to print when queue empties" 132.It "vf str" Ta Dv NULL Ta No "raster image filter" 133.El 134.Pp 135Each two-letter capability has a human-readable alternate name. 136.Bl -column "Short form" "Long form" 137.Sy "Short form Long form" 138.It "af acct.file" 139.It "br tty.rate" 140.It "cf filt.cifplot" 141.It "ct remote.timeout" 142.It "df filt.dvi" 143.It "du daemon.user" 144.It "ff job.formfeed" 145.It "fo job.topofform" 146.It "gf filt.plot" 147.It "hl banner.last" 148.It "if filt.input" 149.It "lf spool.log" 150.It "lo spool.lock" 151.It "lp tty.device" 152.It "mc max.copies" 153.It "ms tty.mode" 154.It "mx max.blocks" 155.It "nf filt.ditroff" 156.It "of filt.output" 157.It "pc acct.price" 158.It "pl page.length" 159.It "pw page.width" 160.It "px page.pwidth" 161.It "py page.plength" 162.It "rc remote.resend_copies" 163.It "rf filt.fortran" 164.It "rg daemon.restrictgrp" 165.It "rm remote.host" 166.It "rp remote.queue" 167.It "rs daemon.restricted" 168.It "rw tty.rw" 169.It "sb banner.short" 170.It "sc job.no_copies" 171.It "sd spool.dir" 172.It "sf job.no_formfeed" 173.It "sh banner.disable" 174.It "sr stat.recv" 175.It "ss stat.send" 176.It "st spool.status" 177.It "tf filt.troff" 178.It "tr job.trailer" 179.It "vf filt.raster" 180.El 181.Pp 182If the local line printer driver supports indentation, the daemon 183must understand how to invoke it. 184.Sh FILTERS 185The 186.Xr lpd 8 187daemon creates a pipeline of 188.Em filters 189to process files for various printer types. 190The filters selected depend on the flags passed to 191.Xr lpr 1 . 192The pipeline set up is: 193.Bd -literal -offset indent 194p pr | if regular text + pr(1) 195none if regular text 196c cf cifplot 197d df DVI (tex) 198g gf plot(3) 199n nf ditroff 200f rf Fortran 201t tf troff 202v vf raster image 203.Ed 204.Pp 205The 206.Sy if 207filter is invoked with arguments: 208.Bd -ragged -offset indent 209.Cm if 210.Op Fl c 211.Fl w Ns Ar width 212.Fl l Ns Ar length 213.Fl i Ns Ar indent 214.Fl n Ar login 215.Fl h Ar host acct-file 216.Ed 217.Pp 218The 219.Fl c 220flag is passed only if the 221.Fl l 222flag (pass control characters literally) 223is specified to 224.Xr lpr 1 . 225The 226.Ar Width 227function 228and 229.Ar length 230specify the page width and length 231(from 232.Cm pw 233and 234.Cm pl 235respectively) in characters. 236The 237.Fl n 238and 239.Fl h 240parameters specify the login name and host name of the owner 241of the job respectively. 242The 243.Ar Acct-file 244function 245is passed from the 246.Cm af 247.Nm 248entry. 249.Pp 250If no 251.Cm if 252is specified, 253.Cm of 254is used instead, 255with the distinction that 256.Cm of 257is opened only once, 258while 259.Cm if 260is opened for every individual job. 261Thus, 262.Cm if 263is better suited to performing accounting. 264The 265.Cm of 266is only given the 267.Ar width 268and 269.Ar length 270flags. 271.Pp 272All other filters are called as: 273.Bd -ragged -offset indent 274.Nm filter 275.Fl x Ns Ar width 276.Fl y Ns Ar length 277.Fl n Ar login 278.Fl h Ar host acct-file 279.Ed 280.Pp 281where 282.Ar width 283and 284.Ar length 285are represented in pixels, 286specified by the 287.Cm px 288and 289.Cm py 290entries respectively. 291.Pp 292All filters take 293.Em stdin 294as the file, 295.Em stdout 296as the printer, 297may log either to 298.Em stderr 299or using 300.Xr syslog 3 , 301and must not ignore 302.Dv SIGINT . 303.Sh REMOTE PRINTING 304When printing to a remote printer using 305.Cm rm , 306it is possible to use either 307.Cm if 308or 309.Cm of . 310If both are specified, 311.Cm of 312is ignored. Both filters behave the same except that they are passed 313different arguments as above. Specifically, the output filter is 314terminated and restarted for each file transmitted. This is necessary 315in order to pass the resulting size to the remote 316.Xr lpd 8 . 317.Pp 318If the 319.Fl p 320flag was passed to 321.Xr lpr 1 , 322.Xr pr 1 323is not executed locally, but is requested of the remote 324.Xr lpd 8 . 325Any input filtering via 326.Cm if 327will therefore happen before 328.Xr pr 1 329is executed rather than afterwards. 330.Pp 331There are some models of network printers which accept jobs from 332.Xr lpd 8 , 333but they ignore the control file for a job and simply print 334each data file as it arrives at the printer. 335One side-effect of this behavior is that the printer will ignore any request 336for multiple copies as given with the 337.Fl # 338flag on the 339.Xr lpr 1 340command. 341The 342.Cm rc 343entry will cause 344.Xr lpd 8 345to resend each data file for each copy that the user 346originally requested. 347Note that the 348.Cm rc 349entry should only be specified on hosts which send jobs directly to 350the printer. 351.Pp 352If 353.Cm lp 354is specified as 355.Em port Ns No @ Ns Em machine 356(and 357.Cm rm 358is not in use), print data will be sent directly to the given 359.Em port 360on the given 361.Em machine . 362.Sh TRANSFER STATISTICS 363When a print job is transfered to a remote machine (which might be 364another unix box, or may be a network printer), it may be useful 365to keep statistics on each transfer. The 366.Cm sr 367and 368.Cm ss 369options indicate filenames that lpd should use to store such 370statistics. A statistics line is written for each datafile of a 371job as the file is successfully transferred. The format of the 372line is the same for both the sending and receiving side of a 373transfer. 374.Pp 375Statistics on datafiles being received would be used on a print 376server, if you are interested in network performance between a 377variety of machines which are sending jobs to that print server. 378The print server could collect statistics on the speed of each 379print job as it arrived on the server. 380.Pp 381Statistics on datafiles being sent might be used as a minimal 382accounting record, when you want to know who sent which jobs to a 383remote printer, when they were sent, and how large (in bytes) the 384files were. This will not give include any idea of how many pages 385were printed, because there is no standard way to get that information 386back from a remote (network) printer in this case. 387.Sh LOGGING 388Error messages generated by the line printer programs themselves 389(that is, the 390.Xr lpd 8 391and related programs) 392are logged by 393.Xr syslog 3 394using the 395.Dv LPR 396facility. 397Messages printed on 398.Em stderr 399of one of the filters 400are sent to the corresponding 401.Cm lf 402file. 403The filters may, of course, use 404.Xr syslogd 8 405themselves. 406.Pp 407Error messages sent to the console have a carriage return and a line 408feed appended to them, rather than just a line feed. 409.Sh SEE ALSO 410.Xr lpq 1 , 411.Xr lpr 1 , 412.Xr lprm 1 , 413.Xr hosts.lpd 5 , 414.Xr termcap 5 , 415.Xr chkprintcap 8 , 416.Xr lpc 8 , 417.Xr lpd 8 , 418.Xr pac 8 419.Rs 420.%T "4.3 BSD Line Printer Spooler Manual" 421.Re 422.Sh HISTORY 423The 424.Nm 425file format appeared in 426.Bx 4.2 . 427