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