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