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