xref: /freebsd/usr.sbin/lpr/lpr/printcap.5 (revision cc16dea626cf2fc80cde667ac4798065108e596c)
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 "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, or" Em port Ns @ Ns Em machine No "to open a TCP socket"
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.
313Both filters behave the same except that they are passed
314different arguments as above.
315Specifically, the output filter is
316terminated and restarted for each file transmitted.
317This is necessary
318in order to pass the resulting size to the remote
319.Xr lpd 8 .
320.Pp
321If the
322.Fl p
323flag was passed to
324.Xr lpr 1 ,
325.Xr pr 1
326is not executed locally, but is requested of the remote
327.Xr lpd 8 .
328Any input filtering via
329.Cm if
330will therefore happen before
331.Xr pr 1
332is executed rather than afterwards.
333.Pp
334There are some models of network printers which accept jobs from
335.Xr lpd 8 ,
336but they ignore the control file for a job and simply print
337each data file as it arrives at the printer.
338One side-effect of this behavior is that the printer will ignore any request
339for multiple copies as given with the
340.Fl #
341flag on the
342.Xr lpr 1
343command.
344The
345.Cm rc
346entry will cause
347.Xr lpd 8
348to resend each data file for each copy that the user
349originally requested.
350Note that the
351.Cm rc
352entry should only be specified on hosts which send jobs directly to
353the printer.
354.Pp
355If
356.Cm lp
357is specified as
358.Em port Ns @ Ns Em machine
359(and
360.Cm rm
361is not in use), print data will be sent directly to the given
362.Em port
363on the given
364.Em machine .
365.Sh TRANSFER STATISTICS
366When a print job is transferred to a remote machine (which might be
367another unix box, or may be a network printer), it may be useful
368to keep statistics on each transfer.
369The
370.Cm sr
371and
372.Cm ss
373options indicate filenames that lpd should use to store such
374statistics.
375A statistics line is written for each datafile of a
376job as the file is successfully transferred.
377The format of the
378line is the same for both the sending and receiving side of a
379transfer.
380.Pp
381Statistics on datafiles being received would be used on a print
382server, if you are interested in network performance between a
383variety of machines which are sending jobs to that print server.
384The print server could collect statistics on the speed of each
385print job as it arrived on the server.
386.Pp
387Statistics on datafiles being sent might be used as a minimal
388accounting record, when you want to know who sent which jobs to a
389remote printer, when they were sent, and how large (in bytes) the
390files were.
391This will not give include any idea of how many pages
392were printed, because there is no standard way to get that information
393back from a remote (network) printer in this case.
394.Sh LOGGING
395Error messages generated by the line printer programs themselves
396(that is, the
397.Xr lpd 8
398and related programs)
399are logged by
400.Xr syslog 3
401using the
402.Dv LPR
403facility.
404Messages printed on
405.Em stderr
406of one of the filters
407are sent to the corresponding
408.Cm lf
409file.
410The filters may, of course, use
411.Xr syslogd 8
412themselves.
413.Pp
414Error messages sent to the console have a carriage return and a line
415feed appended to them, rather than just a line feed.
416.Sh SEE ALSO
417.Xr lpq 1 ,
418.Xr lpr 1 ,
419.Xr lprm 1 ,
420.Xr hosts.lpd 5 ,
421.Xr termcap 5 ,
422.Xr chkprintcap 8 ,
423.Xr lpc 8 ,
424.Xr lpd 8 ,
425.Xr pac 8
426.Rs
427.%T "4.3 BSD Line Printer Spooler Manual"
428.Re
429.Sh HISTORY
430The
431.Nm
432file format appeared in
433.Bx 4.2 .
434