xref: /plan9/sys/doc/lp.ms (revision 2cca75a1b2b8c6083390679d69d5c50cf66d9a01)
1*2cca75a1SDavid du Colombier.HTML "A Guide to the Lp Printer Spooler
2219b2ee8SDavid du Colombier.TL
3219b2ee8SDavid du ColombierA Guide to the Lp
4219b2ee8SDavid du ColombierPrinter Spooler
5219b2ee8SDavid du Colombier.AU
6219b2ee8SDavid du ColombierPaul Glick
77dd7cddfSDavid du Colombierpg@plan9.bell-labs.com
8219b2ee8SDavid du Colombier.AB
9219b2ee8SDavid du Colombier.PP
10219b2ee8SDavid du Colombier.I Lp
11219b2ee8SDavid du Colombieris a collection of programs used to provide an easy-to-use
12219b2ee8SDavid du Colombierinterface for printing a variety of document types on a variety
13219b2ee8SDavid du Colombierof printers.
14219b2ee8SDavid du Colombier.I Lp
15219b2ee8SDavid du Colombieris the glue that connects various document language
16219b2ee8SDavid du Colombiertranslators and printer communication programs together so that
17219b2ee8SDavid du Colombierthe users may have a consistent view of printers.
18219b2ee8SDavid du ColombierMost of the glue
19219b2ee8SDavid du Colombieris shell script, which can be easily modified.
20219b2ee8SDavid du ColombierThe user need not
21219b2ee8SDavid du Colombierspecify options to get sensible output in most cases.
22219b2ee8SDavid du Colombier.I Lp
23219b2ee8SDavid du Colombieris described here
24219b2ee8SDavid du Colombierso that others may make additions and changes.
25219b2ee8SDavid du Colombier.AE
26219b2ee8SDavid du Colombier\" .2C
27219b2ee8SDavid du Colombier.NH
28219b2ee8SDavid du ColombierIntroduction
29219b2ee8SDavid du Colombier.PP
30219b2ee8SDavid du Colombier.I Lp
31219b2ee8SDavid du Colombieris used to format and print data on a variety of output devices.
32219b2ee8SDavid du ColombierThe need for
33219b2ee8SDavid du Colombier.I lp
34219b2ee8SDavid du Colombierwas rooted in the inability of other printer spoolers to do simple
35219b2ee8SDavid du Colombiertasks without a great deal of user specification of options.
36219b2ee8SDavid du ColombierAt the time
37219b2ee8SDavid du Colombier.I lp
38219b2ee8SDavid du Colombierwas written, there were several printer
39219b2ee8SDavid du Colombierlanguages, such as ImPress and PostScript, and
40219b2ee8SDavid du Colombieran internally developed printer that would accept
41219b2ee8SDavid du Colombier.I troff
42219b2ee8SDavid du Colombieroutput.
43219b2ee8SDavid du ColombierNow, all our printers take PostScript,
44219b2ee8SDavid du Colombierbut printers that use HPCL and HPGL abound and
45219b2ee8SDavid du Colombiersupport for those printers may be added easily.
46219b2ee8SDavid du ColombierA great deal of what underlies
47219b2ee8SDavid du Colombier.I lp
48219b2ee8SDavid du Colombieris taken from BSD's
49219b2ee8SDavid du Colombier.I lpr
50219b2ee8SDavid du Colombierand System V's
51219b2ee8SDavid du Colombier.I lp .
52219b2ee8SDavid du ColombierThe important features of this system are that most of the programs
53219b2ee8SDavid du Colombierare easily modified shell scripts and the user need not
54219b2ee8SDavid du Colombierlearn to use the large amount of underlying software developed by others.
55219b2ee8SDavid du Colombier.I Lp
56219b2ee8SDavid du Colombierruns under Plan 9 and several flavors of
57219b2ee8SDavid du ColombierUNIX.
58219b2ee8SDavid du ColombierThis document deals with
59219b2ee8SDavid du Colombier.I lp
60219b2ee8SDavid du Colombieras it relates to Plan 9.
61219b2ee8SDavid du Colombier.I Lp
62219b2ee8SDavid du Colombierwas developed using both Datakit and Ethernet to transport data between machines.
63219b2ee8SDavid du ColombierNow only the Ethernet transport mechanism remains.
64219b2ee8SDavid du Colombier.PP
65219b2ee8SDavid du ColombierText, graphics, and formatted text files are appropriately processed and
66219b2ee8SDavid du Colombierplaced into a spool directory from which they are taken to be printed by a daemon process.
67219b2ee8SDavid du ColombierAdditional functions include checking the status of a printer queue
68219b2ee8SDavid du Colombierand removing jobs from the printer queue.
69219b2ee8SDavid du Colombier.PP
70219b2ee8SDavid du ColombierAll the shell scripts (see
71219b2ee8SDavid du Colombier.I rc (1))
72219b2ee8SDavid du Colombierassociated with
73219b2ee8SDavid du Colombier.I lp
74219b2ee8SDavid du Colombierreside in the spool directory
75219b2ee8SDavid du Colombier.CW /sys/lib/lp
76219b2ee8SDavid du Colombierexcept for the
77219b2ee8SDavid du Colombier.I lp
78219b2ee8SDavid du Colombiercommand itself, which resides in
79219b2ee8SDavid du Colombier.CW /rc/bin .
80219b2ee8SDavid du ColombierCommands related to
81219b2ee8SDavid du Colombier.I lp
82219b2ee8SDavid du Colombierthat are not shell scripts can most often be found
83219b2ee8SDavid du Colombierin
84219b2ee8SDavid du Colombier.CW /$cputype/bin/aux .
85219b2ee8SDavid du ColombierThe directory where all the
86219b2ee8SDavid du Colombier.I lp
87219b2ee8SDavid du Colombierscripts  reside is defined within
88219b2ee8SDavid du Colombier.I lp
89219b2ee8SDavid du Colombierby the shell variable
90219b2ee8SDavid du Colombier.CW LPLIB .
91219b2ee8SDavid du ColombierIn the remainder of this document, file names will be specified
92219b2ee8SDavid du Colombierwith this shell variable as their root.
93219b2ee8SDavid du Colombier.NH
94219b2ee8SDavid du ColombierUsage
95219b2ee8SDavid du Colombier.PP
96219b2ee8SDavid du Colombier.I Lp
97219b2ee8SDavid du Colombierrequires an output device to be specified
98219b2ee8SDavid du Colombierbefore it will process input.
99219b2ee8SDavid du ColombierThis can be done in any of three ways described here.
100219b2ee8SDavid du Colombier.IP 1)
101219b2ee8SDavid du ColombierThe file
102219b2ee8SDavid du Colombier.CW $LPLIB/defdevice
103219b2ee8SDavid du Colombiermay contain the name of a default output device.
104219b2ee8SDavid du ColombierThis may not be practical for environments where
105219b2ee8SDavid du Colombierthere are many printers.
106219b2ee8SDavid du Colombier.IP 2)
107219b2ee8SDavid du ColombierThe user's environment variable
108219b2ee8SDavid du Colombier.CW LPDEST
109219b2ee8SDavid du Colombiermay be set to the name of the device to be used.
110219b2ee8SDavid du ColombierThis is often a more practical solution when there are several printers
111219b2ee8SDavid du Colombieravailable.
112219b2ee8SDavid du ColombierThis overrides a
113219b2ee8SDavid du Colombier.CW defdevice
114219b2ee8SDavid du Colombierspecification.
115219b2ee8SDavid du Colombier.IP 3)
116219b2ee8SDavid du ColombierThe
117219b2ee8SDavid du Colombier.CW -d
118219b2ee8SDavid du Colombier.I printer
119219b2ee8SDavid du Colombieroption to the
120219b2ee8SDavid du Colombier.I lp
121219b2ee8SDavid du Colombiercommand specifies
122219b2ee8SDavid du Colombier.I printer
123219b2ee8SDavid du Colombieras the device to which output should be directed, overriding the
124219b2ee8SDavid du Colombierprevious two specifications.
125219b2ee8SDavid du Colombier.PP
126219b2ee8SDavid du Colombier.ti 0
127219b2ee8SDavid du ColombierIf
128219b2ee8SDavid du Colombier.I printer
129219b2ee8SDavid du Colombieris
130219b2ee8SDavid du Colombier.CW ? ,
131219b2ee8SDavid du Colombiera list of printers and other information in the
132219b2ee8SDavid du Colombier.CW devices
133219b2ee8SDavid du Colombierfile is printed, as shown in Figure 1.
134219b2ee8SDavid du ColombierQuote the question mark to prevent it from being
135219b2ee8SDavid du Colombierinterpreted by the shell language as a metacharacter.
136219b2ee8SDavid du Colombier\" .1C
137219b2ee8SDavid du Colombier.KF
138219b2ee8SDavid du Colombier.P1
139219b2ee8SDavid du Colombier% lp -d'?'
140219b2ee8SDavid du Colombierdevice   location  host             class
141219b2ee8SDavid du Colombierfn       2C-501    helix            post/2+600dpi+duplex
142219b2ee8SDavid du Colombierpcclone  -         -                post+nohead
143219b2ee8SDavid du Colombierpeacock  2C-501    cetus            post/2+300dpi+nohead+color
144219b2ee8SDavid du Colombierps83     st8_fl3   rice             post+300dpi+reverse
145219b2ee8SDavid du Colombierpsu      2C-501    cetus            post/2+1200dpi
146219b2ee8SDavid du Colombier     .
147219b2ee8SDavid du Colombier     .
148219b2ee8SDavid du Colombier     .
149219b2ee8SDavid du Colombier%
150219b2ee8SDavid du Colombier.P2
151219b2ee8SDavid du Colombier.ce
152219b2ee8SDavid du Colombier.I "Figure 1.  Sample listing of installed printers"
153219b2ee8SDavid du Colombier.KE
154219b2ee8SDavid du Colombier.PP
155219b2ee8SDavid du ColombierNormally,
156219b2ee8SDavid du Colombier.I lp
157219b2ee8SDavid du Colombieruses the
158219b2ee8SDavid du Colombier.CW file
159219b2ee8SDavid du Colombiercommand to figure out what type of input it is receiving.
160219b2ee8SDavid du ColombierThis is done within the
161219b2ee8SDavid du Colombier.CW generic
162219b2ee8SDavid du Colombierprocess which is discussed later in this paper in the
163219b2ee8SDavid du Colombier.B "Process directory"
164219b2ee8SDavid du Colombiersection.
165219b2ee8SDavid du ColombierTo select a specific input processor the
166219b2ee8SDavid du Colombier\f(CW-p\fP\fIprocess\fP
167219b2ee8SDavid du Colombieroption is used where
168219b2ee8SDavid du Colombier.I process
169219b2ee8SDavid du Colombieris one of the shell scripts in the
170219b2ee8SDavid du Colombier.CW process
171219b2ee8SDavid du Colombierdirectory.
172219b2ee8SDavid du Colombier.LP
173219b2ee8SDavid du ColombierTroff
174219b2ee8SDavid du Colombieroutput can be printed, in this case, on printer
175219b2ee8SDavid du Colombier.I fn
176219b2ee8SDavid du Colombierwith
177219b2ee8SDavid du Colombier.P1
178219b2ee8SDavid du Colombier% troff -ms lp.ms | lp -dfn
179219b2ee8SDavid du Colombier.P2
180219b2ee8SDavid du Colombier.LP
181219b2ee8SDavid du ColombierA file can be converted to PostScript using the pseudo-printer
182219b2ee8SDavid du Colombier.CW stdout :
183219b2ee8SDavid du Colombier.P1
184219b2ee8SDavid du Colombier% troff -ms lp.ms | lp -dstdout > lp.ps
185219b2ee8SDavid du Colombier.P2
186219b2ee8SDavid du ColombierLaTeX (and analogously TeX)
187219b2ee8SDavid du Colombierdocuments are printed in two steps:
188219b2ee8SDavid du Colombier.P1
189219b2ee8SDavid du Colombier% latex lp.tex
190219b2ee8SDavid du Colombier     .
191219b2ee8SDavid du Colombier     .
192219b2ee8SDavid du Colombier% lp lp.dvi
193219b2ee8SDavid du Colombier     .
194219b2ee8SDavid du Colombier     .
195219b2ee8SDavid du Colombier%
196219b2ee8SDavid du Colombier.P2
197219b2ee8SDavid du ColombierLaTeX
198219b2ee8SDavid du Colombierproduces a `.dvi' file and
199219b2ee8SDavid du Colombierdoes not permit the use of a pipe
200219b2ee8SDavid du Colombierconnection to the standard input of
201219b2ee8SDavid du Colombier.I lp .
202219b2ee8SDavid du ColombierTo look at the status and queue of a device, use
203219b2ee8SDavid du Colombier.CW -q :
204219b2ee8SDavid du Colombier.P1
205219b2ee8SDavid du Colombier% lp -dpsu -q
206219b2ee8SDavid du Colombierdaemon status:
207219b2ee8SDavid du Colombier:  67.17% sent
208219b2ee8SDavid du Colombierprinter status:
209219b2ee8SDavid du Colombier%%[ status: busy; source: lpd ]%%
210219b2ee8SDavid du Colombier
211219b2ee8SDavid du Colombierqueue on cetus:
212219b2ee8SDavid du Colombierjob		user	try	size
213219b2ee8SDavid du Colombierrice29436.1	pg	0	17454
214219b2ee8SDavid du Colombierslocum17565.1	ches	1	49995
215219b2ee8SDavid du Colombier%
216219b2ee8SDavid du Colombier.P2
217219b2ee8SDavid du ColombierThis command can print the status and queue of the local
218219b2ee8SDavid du Colombierand remote hosts.
219219b2ee8SDavid du ColombierAdministrators should be advised that working in an environment where the
220219b2ee8SDavid du Colombier.I lp
221219b2ee8SDavid du Colombierspool directory is shared among the local and remote hosts,
222219b2ee8SDavid du Colombierno spooling should be done on the local hosts.
223219b2ee8SDavid du ColombierThe format of the status and queue printout is up to the administrator.
224219b2ee8SDavid du ColombierThe job started above can be killed with
225219b2ee8SDavid du Colombier.CW -k :
226219b2ee8SDavid du Colombier.P1
227219b2ee8SDavid du Colombier$ lp -dpsu -k rice29436.1
228219b2ee8SDavid du Colombierrice29436.1 removed from psu queue on cetus
229219b2ee8SDavid du Colombier.P2
230219b2ee8SDavid du Colombier.NH
231219b2ee8SDavid du ColombierOptions
232219b2ee8SDavid du Colombier.PP
233219b2ee8SDavid du ColombierThere are options available to modify the way in which a job is handled.
234219b2ee8SDavid du ColombierIt is the job of the
235219b2ee8SDavid du Colombier.I lp
236219b2ee8SDavid du Colombierprograms to convert the option settings so they may be used by each of the
237219b2ee8SDavid du Colombierdifferent translation and interface programs.
238219b2ee8SDavid du ColombierNot all options are applicable to all printer environments.
239219b2ee8SDavid du ColombierTable 1 lists the standard
240219b2ee8SDavid du Colombier.I lp
241219b2ee8SDavid du Colombieroptions, the shell variable settings, and description of the options.
242219b2ee8SDavid du Colombier\" .1C
243219b2ee8SDavid du Colombier.KF
244219b2ee8SDavid du Colombier.sp
245219b2ee8SDavid du Colombier.in 0
246219b2ee8SDavid du Colombier.TS
247219b2ee8SDavid du Colombiercenter;
248219b2ee8SDavid du Colombierc | c s s | c
249219b2ee8SDavid du Colombierc | c c c | c
250219b2ee8SDavid du ColombierlfCWp-2 | lfCWp-2 cfCWp-2 cfCWp-2 | lp-2w(3i).
251219b2ee8SDavid du Colombier=
252219b2ee8SDavid du Colombieroption	shell variable	action
253219b2ee8SDavid du Colombier\^	name	default	set	\^
254219b2ee8SDavid du Colombier_
255219b2ee8SDavid du Colombier-D	DEBUG	N	1	turn on debugging mode.
256219b2ee8SDavid du Colombier_
257219b2ee8SDavid du Colombier-H	NOHEADER	N	1	suppress header page.
258219b2ee8SDavid du Colombier_
259219b2ee8SDavid du Colombier-L	LAND	N	1	make long page dimension horizontal.
260219b2ee8SDavid du Colombier_
261219b2ee8SDavid du Colombier-M \fImach\fP	LPMACHID	N	\fImach\fP	set the source machine name.
262219b2ee8SDavid du Colombier_
263219b2ee8SDavid du Colombier-Q	QONLY	N	1	do not execute daemon; for debugging.
264219b2ee8SDavid du Colombier_
265219b2ee8SDavid du Colombier-c \fIn\fP	COPIES	N	\fIn\fP	number of copies to be printed.
266219b2ee8SDavid du Colombier_
267219b2ee8SDavid du Colombier-d \fIprinter\fP	LPDEST	U	\fIprinter\fP	set job destination; override other settings.
268219b2ee8SDavid du Colombier_
269219b2ee8SDavid du Colombier-f \fIfont.pt\fP	FONT	N	\fIfont\fP	set font style and point size for printing.
270219b2ee8SDavid du Colombier	POINT	N	\fIpt\fP
271219b2ee8SDavid du Colombier_
272219b2ee8SDavid du Colombier-i \fIn\fP	IBIN	N	\fIn\fP	T{
273219b2ee8SDavid du Colombierselect input paper tray options.
274219b2ee8SDavid du ColombierThe argument given is dependent on the printer type.
275219b2ee8SDavid du ColombierA number can be given to select a particular tray and/or
276219b2ee8SDavid du Colombier.CW simplex
277219b2ee8SDavid du Colombieror
278219b2ee8SDavid du Colombier.CW duplex
279219b2ee8SDavid du Colombiermay be used to get single or double sided output, where
280219b2ee8SDavid du Colombierapplicable.
281219b2ee8SDavid du ColombierMultiple options should be separated by commas.
282219b2ee8SDavid du ColombierT}
283219b2ee8SDavid du Colombier_
284219b2ee8SDavid du Colombier-k	KILLFLAG	0	1	T{
285219b2ee8SDavid du Colombiertake non-option arguments as job numbers to be removed from queue.
286219b2ee8SDavid du ColombierT}
287219b2ee8SDavid du Colombier_
288219b2ee8SDavid du Colombier-l \fIn\fP	LINES	N	\fIn\fP	T{
289219b2ee8SDavid du Colombierfor printed data, the number of lines per logical page.
290219b2ee8SDavid du ColombierT}
291219b2ee8SDavid du Colombier_
292219b2ee8SDavid du Colombier-m \fIf\fP	MAG	N	\fIf\fP	T{
293219b2ee8SDavid du Colombiermagnify the image by a factor \fIf\fP.
294219b2ee8SDavid du ColombierThe factor should be a positive real number.
295219b2ee8SDavid du ColombierT}
296219b2ee8SDavid du Colombier_
297219b2ee8SDavid du Colombier-n \fIn\fP	NPAG	N	\fIn\fP	T{
298219b2ee8SDavid du Colombierput \fIn\fP logical pages on a single physical page.
299219b2ee8SDavid du ColombierA simple algorithm is used to pack the pages.
300219b2ee8SDavid du ColombierT}
301219b2ee8SDavid du Colombier_
302219b2ee8SDavid du Colombier-o \fIlist\fP	OLIST	N	\fIlist\fP	T{
303219b2ee8SDavid du Colombierprint only those pages specified in the list.
304219b2ee8SDavid du ColombierThe list may be a sequence of numbers or ranges separated by commas.
305219b2ee8SDavid du ColombierA range is a pair of numbers separated by a hyphen.
306219b2ee8SDavid du ColombierT}
307219b2ee8SDavid du Colombier_
308219b2ee8SDavid du Colombier-p \fIproc\fP	LPPROC	L	\fIproc\fP	T{
309219b2ee8SDavid du Colombieruse the preprocessor \fIproc\fP instead of the preprocessor given
310219b2ee8SDavid du Colombierin the
311219b2ee8SDavid du Colombier.CW devices
312219b2ee8SDavid du Colombierfile for this printer.
313219b2ee8SDavid du ColombierT}
314219b2ee8SDavid du Colombier_
315219b2ee8SDavid du Colombier-q	LPQ	N	1	T{
316219b2ee8SDavid du Colombierprint the status and queue.
317219b2ee8SDavid du ColombierT}
318219b2ee8SDavid du Colombier_
319219b2ee8SDavid du Colombier-r	REVERSE	L	1	T{
320219b2ee8SDavid du Colombierthis toggles the
321219b2ee8SDavid du Colombier.CW REVERSE
322219b2ee8SDavid du Colombierflag, changing whether or not page reversal should occur in preprocessing.
323219b2ee8SDavid du ColombierPage reversal is needed if a printer delivers pages face up.
324219b2ee8SDavid du ColombierThe keyword
325219b2ee8SDavid du Colombier.CW reverse
326219b2ee8SDavid du Colombiercan be placed in the
327219b2ee8SDavid du Colombier.I lpclass
328219b2ee8SDavid du Colombierfield of the
329219b2ee8SDavid du Colombier.CW devices
330219b2ee8SDavid du Colombierfile.
331219b2ee8SDavid du ColombierIf a document has already been processed this flag has no effect.
332219b2ee8SDavid du ColombierT}
333219b2ee8SDavid du Colombier_
334219b2ee8SDavid du Colombier-u \fIuser\fP	LPUSERID	U	\fIuser\fP	T{
335219b2ee8SDavid du Colombierchange the user id that appears on the cover page.
336219b2ee8SDavid du ColombierT}
337219b2ee8SDavid du Colombier_
338219b2ee8SDavid du Colombier-x \fIoffset\fP	XOFF	N	\fIoffset\fP	T{
339219b2ee8SDavid du Colombiermove the image \fIoffset\fP inches to the right.
340219b2ee8SDavid du ColombierA negative \fIoffset\fP will move the image to the left.
341219b2ee8SDavid du ColombierThe \fIoffset\fP may be any reasonable real number.
342219b2ee8SDavid du ColombierT}
343219b2ee8SDavid du Colombier_
344219b2ee8SDavid du Colombier-y \fIoffset\fP	YOFF	N	\fIoffset\fP	T{
345219b2ee8SDavid du Colombiersame as for
346219b2ee8SDavid du Colombier.CW -x
347219b2ee8SDavid du Colombierexcept a positive offset will move the image down.
348219b2ee8SDavid du ColombierT}
349219b2ee8SDavid du Colombier_
350219b2ee8SDavid du Colombier.T&
351219b2ee8SDavid du Colombierl l cp-2 lp-2 s
352219b2ee8SDavid du Colombierl l cfCWp-2 lp-2 s.
353219b2ee8SDavid du Colombier.vs -2p
354219b2ee8SDavid du Colombier
355219b2ee8SDavid du Colombier		default	setting definition
356219b2ee8SDavid du Colombier		N	set to the null string (`') initially in \fIlp\fP.
357219b2ee8SDavid du Colombier		L	set from printer entry in \f(CW\\s-\\n(XPdevices\\s+\\n(XP\fP file.
358219b2ee8SDavid du Colombier		U	set from the user's environment.
359219b2ee8SDavid du Colombier.vs +2p
360219b2ee8SDavid du Colombier.TE
361219b2ee8SDavid du Colombier.sp
362219b2ee8SDavid du Colombier.ce
363219b2ee8SDavid du Colombier.I "Table 1. Lp Option List"
364219b2ee8SDavid du Colombier.sp
365219b2ee8SDavid du Colombier.ll \\n(LLu
366219b2ee8SDavid du Colombier.KE
367219b2ee8SDavid du Colombier\" .2C
368219b2ee8SDavid du Colombier.NH
369219b2ee8SDavid du ColombierDevices file
370219b2ee8SDavid du Colombier.PP
371219b2ee8SDavid du ColombierThe
372219b2ee8SDavid du Colombier.CW devices
373219b2ee8SDavid du Colombierfile is found in the spool directory.
374219b2ee8SDavid du ColombierEach line in the file is composed of 12 fields, separated
375219b2ee8SDavid du Colombierby tabs or spaces, that describe the attributes
376219b2ee8SDavid du Colombierof the printer and how it should be serviced.
377219b2ee8SDavid du ColombierWithin the
378219b2ee8SDavid du Colombier.CW lp
379219b2ee8SDavid du Colombiercommand, a shell variable is set for each attribute;
380219b2ee8SDavid du Colombierthe following list describes them:
381*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPLPDEST\s+\n(XP\fP " 12
382219b2ee8SDavid du Colombieris the name of the device as given to
383219b2ee8SDavid du Colombier.I lp
384219b2ee8SDavid du Colombierwith the
385219b2ee8SDavid du Colombier.CW -d
386219b2ee8SDavid du Colombieroption
387219b2ee8SDavid du Colombieror as specified by the shell environment variable
388219b2ee8SDavid du Colombier.CW LPDEST
389219b2ee8SDavid du Colombieror as specified by
390219b2ee8SDavid du Colombierthe file
391219b2ee8SDavid du Colombier.CW $LPLIB/defdevice .
392219b2ee8SDavid du ColombierThis name is used in creating directories and log files that are associated with
393219b2ee8SDavid du Colombierthe printers operation.
394*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPLOC\s+\n(XP\fP "
395219b2ee8SDavid du Colombierjust describes where the printer is physically located.
396*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPDEST_HOST\s+\n(XP\fP "
397219b2ee8SDavid du Colombieris the host from which the files are printed.
398219b2ee8SDavid du ColombierFiles may be spooled on other machines before being transferred to the
399219b2ee8SDavid du Colombierdestination host.
400*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPOUT_DEV\s+\n(XP\fP "
401219b2ee8SDavid du Colombieris the physical device name or network address needed by the printer daemon
402219b2ee8SDavid du Colombierto connect to the printer.
403219b2ee8SDavid du ColombierThis field depends on the requirements of the daemon and may contain a `\(en'
404219b2ee8SDavid du Colombierif not required.
405*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPSPEED\s+\n(XP\fP "
406219b2ee8SDavid du Colombieris the baud rate setting for the port.
407219b2ee8SDavid du ColombierThis field depends on the requirements of the daemon and may contain a `\(en'
408219b2ee8SDavid du Colombierif not required.
409*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPLPCLASS\s+\n(XP\fP "
410219b2ee8SDavid du Colombieris used to encode minor printer differences.
411219b2ee8SDavid du ColombierThe keyword
412219b2ee8SDavid du Colombier.CW reverse
413219b2ee8SDavid du Colombieris used by some of the preprocessors
414219b2ee8SDavid du Colombierto reverse the order the pages are printed to accommodate different output
415219b2ee8SDavid du Colombiertrays (either face up or face down).
416219b2ee8SDavid du ColombierThe keyword
417219b2ee8SDavid du Colombier.CW nohead
418219b2ee8SDavid du Colombieris used to suppress the header page.
419219b2ee8SDavid du ColombierThis is used for special and color printers.
420219b2ee8SDavid du ColombierThe keyword
421219b2ee8SDavid du Colombier.CW duplex
422219b2ee8SDavid du Colombieris used to coax double sided output from duplex printers.
423*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPLPPROC\s+\n(XP\fP "
424219b2ee8SDavid du Colombieris the command from the
425219b2ee8SDavid du Colombier.CW LPLIB/process
426219b2ee8SDavid du Colombierdirectory to be used to convert input to a format
427219b2ee8SDavid du Colombierthat will be accepted by the device.
428219b2ee8SDavid du ColombierThe preprocessor is invoked by the spooler.
429*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPSPOOLER\s+\n(XP\fP "
430219b2ee8SDavid du Colombieris the command from the
431219b2ee8SDavid du Colombier.CW LPLIB/spooler
432219b2ee8SDavid du Colombierdirectory which will select files using the
433219b2ee8SDavid du Colombier.CW SCHED
434219b2ee8SDavid du Colombiercommand and invoke the
435219b2ee8SDavid du Colombier.CW LPPROC
436219b2ee8SDavid du Colombiercommand, putting its output
437219b2ee8SDavid du Colombierinto the remote spool directory.
438219b2ee8SDavid du ColombierThe output is sent directly to the spool directory on the
439219b2ee8SDavid du Colombierdestination machine to avoid conflicts when client and
440219b2ee8SDavid du Colombierserver machines share spool directories.
441*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPSTAT\s+\n(XP\fP "
442219b2ee8SDavid du Colombieris the command from the
443219b2ee8SDavid du Colombier.CW LPLIB/stat
444219b2ee8SDavid du Colombierdirectory that prints the status of the device and the list of jobs
445219b2ee8SDavid du Colombierwaiting on the queue for the device.
446219b2ee8SDavid du ColombierThe status information depends on what is available from the printer
447219b2ee8SDavid du Colombierand interface software.
448219b2ee8SDavid du ColombierThe queue information should be changed to show information
449219b2ee8SDavid du Colombieruseful in tracking down problems.
450219b2ee8SDavid du ColombierThe
451219b2ee8SDavid du Colombier.CW SCHED
452219b2ee8SDavid du Colombiercommand is used to show the jobs in the order
453219b2ee8SDavid du Colombierin which they will be printed.
454*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPKILL\s+\n(XP\fP "
455219b2ee8SDavid du Colombieris the command from the
456219b2ee8SDavid du Colombier.CW LPLIB/kill
457219b2ee8SDavid du Colombierthat removes jobs from the queue.
458219b2ee8SDavid du ColombierThe jobs to be removed are given as arguments to the
459219b2ee8SDavid du Colombier.I lp
460219b2ee8SDavid du Colombiercommand.
461219b2ee8SDavid du ColombierWhen possible, it should also abort the currently running job
462219b2ee8SDavid du Colombierif it has to be killed.
463*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPDAEMON\s+\n(XP\fP "
464219b2ee8SDavid du Colombieris the command from the
465219b2ee8SDavid du Colombier.CW LPLIB/daemon
466219b2ee8SDavid du Colombierthat is meant to run asynchronously to remove
467219b2ee8SDavid du Colombierjobs from the queue.
468219b2ee8SDavid du ColombierJobs may either be passed on to another host or sent to the
469219b2ee8SDavid du Colombierprinting device.
470219b2ee8SDavid du Colombier.I Lp
471219b2ee8SDavid du Colombieralways tries to start a daemon process when one is specified.
472*2cca75a1SDavid du Colombier.IP "\f(CW\s-\n(XPSCHED\s+\n(XP\fP "
473219b2ee8SDavid du Colombieris the command from the
474219b2ee8SDavid du Colombier.CW LPLIB/sched
475219b2ee8SDavid du Colombierthat is used to present the job names to the
476219b2ee8SDavid du Colombierdaemon and stat programs
477219b2ee8SDavid du Colombierin some order, e.g., first-in-first-out, smallest first.
478219b2ee8SDavid du Colombier.NH
479219b2ee8SDavid du ColombierSupport programs
480219b2ee8SDavid du Colombier.PP
481219b2ee8SDavid du ColombierThe following sections describe the basic functions of the programs
482219b2ee8SDavid du Colombierthat are found in the subdirectories of
483219b2ee8SDavid du Colombier.CW $LPLIB .
484219b2ee8SDavid du ColombierThe programs in a specific directory vary with the
485219b2ee8SDavid du Colombiertype of output device or networks that have to be used.
486219b2ee8SDavid du Colombier.NH 2
487219b2ee8SDavid du ColombierProcess directory
488219b2ee8SDavid du Colombier.PP
489219b2ee8SDavid du ColombierThe
490219b2ee8SDavid du Colombier.CW generic
491219b2ee8SDavid du Colombierpreprocessor
492219b2ee8SDavid du Colombieris the default preprocessor for most printers.
493219b2ee8SDavid du ColombierIt uses the
494219b2ee8SDavid du Colombier.I file (1)
495219b2ee8SDavid du Colombiercommand to determine the format of the input file.
496219b2ee8SDavid du ColombierThe appropriate preprocessor is then selected to transform the
497219b2ee8SDavid du Colombierfile to a format suitable for the printer.
498219b2ee8SDavid du Colombier.PP
4997dd7cddfSDavid du ColombierHere is a list of some of the preprocessors and
500219b2ee8SDavid du Colombiera description of their function.
5017dd7cddfSDavid du ColombierA complete list of preprocessors and their descriptions can be found in the manual page
5027dd7cddfSDavid du Colombier.I lp (8).
503219b2ee8SDavid du Colombier.sp
504219b2ee8SDavid du Colombier.IP \f(CWdvipost\fP 14
505219b2ee8SDavid du ColombierConverts TeX or LaTeX output (\f(CW.dvi\fP files) to PostScript
506219b2ee8SDavid du Colombier.IP \f(CWppost\fP
507219b2ee8SDavid du ColombierConverts UTF text to PostScript.
508219b2ee8SDavid du ColombierThe default font is Courier with Lucida fonts filling in
509219b2ee8SDavid du Colombierthe remainder of the (available) Unicode character space.
510219b2ee8SDavid du Colombier.IP \f(CWtr2post\fP
511219b2ee8SDavid du ColombierConverts (device independent) troff output for the device type
512219b2ee8SDavid du Colombier.CW utf .
513219b2ee8SDavid du ColombierSee
514219b2ee8SDavid du Colombier.CW /sys/lib/troff/font/devutf
515219b2ee8SDavid du Colombierdirectory for troff font width table descriptions.
516219b2ee8SDavid du ColombierSee also the
517219b2ee8SDavid du Colombier.CW /sys/lib/postscript/troff
518219b2ee8SDavid du Colombierdirectory for mappings of
5197dd7cddfSDavid du Colombiertroff
5207dd7cddfSDavid du Colombier.CW UTF
5217dd7cddfSDavid du Colombiercharacter space to PostScript font space.
522219b2ee8SDavid du Colombier.IP \f(CWp9bitpost\fP
523219b2ee8SDavid du ColombierConverts Plan 9 bitmaps (see
524219b2ee8SDavid du Colombier.I bitfile (9.6))
525219b2ee8SDavid du Colombierto PostScript.
526219b2ee8SDavid du Colombier.IP \f(CWg3post\fP
527219b2ee8SDavid du ColombierConverts fax (CCITT-G31 format) to PostScript.
528219b2ee8SDavid du Colombier.IP \f(CWhpost\fP
529219b2ee8SDavid du ColombierDoes header page processing and page reversal processing, if
530219b2ee8SDavid du Colombiernecessary.
531219b2ee8SDavid du ColombierPage reversal is done here so the header page always comes
532219b2ee8SDavid du Colombierout at the beginning of the job.
533219b2ee8SDavid du ColombierHeader page processing is very location-dependent.
534219b2ee8SDavid du Colombier.NH 2
535219b2ee8SDavid du ColombierSpool directory
536219b2ee8SDavid du Colombier.PP
537219b2ee8SDavid du ColombierThe
538219b2ee8SDavid du Colombier.CW generic
539219b2ee8SDavid du Colombierspooler is responsible for executing the preprocessor
540219b2ee8SDavid du Colombierand directing its output to a file in the printer's queue.
541219b2ee8SDavid du ColombierAn additional file is created containing information such as the system name,
542219b2ee8SDavid du Colombieruser id, job number, and number of times this job was attempted.
543219b2ee8SDavid du Colombier.PP
544219b2ee8SDavid du ColombierCertain printer handling programs do not require separate
545219b2ee8SDavid du Colombierpreprocessing and spooling.
546219b2ee8SDavid du ColombierFor such circumstances a
547219b2ee8SDavid du Colombier.CW nospool
548219b2ee8SDavid du Colombierspooler is available that just executes the preprocessing program.
549219b2ee8SDavid du ColombierThe processing and spooling functions are assumed by this program and the output is sent to
550219b2ee8SDavid du Colombier.CW OUT_DEV
551219b2ee8SDavid du Colombieror standard output if
552219b2ee8SDavid du Colombier.CW OUT_DEV
553219b2ee8SDavid du Colombieris '-'.
554219b2ee8SDavid du Colombier.PP
555219b2ee8SDavid du ColombierThe
556219b2ee8SDavid du Colombier.CW pcclone
557219b2ee8SDavid du Colombierspooler is used to send print jobs directly to a printer connected
558219b2ee8SDavid du Colombierto a 386 compatible printer port (See
559219b2ee8SDavid du Colombier.I lpt (3)).
560219b2ee8SDavid du Colombier.NH 2
561219b2ee8SDavid du ColombierStat directory
562219b2ee8SDavid du Colombier.PP
563219b2ee8SDavid du ColombierThe function of the shell scripts in the
564219b2ee8SDavid du Colombier.CW stat
565219b2ee8SDavid du Colombierdirectory is to present status information about the
566219b2ee8SDavid du Colombierprinter and its queue.
567219b2ee8SDavid du ColombierWhen necessary, the
568219b2ee8SDavid du Colombier.CW stat
569219b2ee8SDavid du Colombierscripts may be designed
570219b2ee8SDavid du Colombierto return information about the local queue as well as the remote queue.
571219b2ee8SDavid du ColombierThis is not done on Plan 9 because many systems share the same queue directory.
572219b2ee8SDavid du ColombierThe scheduler is used to print the queue in the order in which the jobs
573219b2ee8SDavid du Colombierwill be executed.
574219b2ee8SDavid du Colombier.NH 2
575219b2ee8SDavid du ColombierKill directory
576219b2ee8SDavid du Colombier.PP
577219b2ee8SDavid du ColombierThe
578219b2ee8SDavid du Colombier.CW kill
579219b2ee8SDavid du Colombierscripts receive command line arguments passed to them by
580219b2ee8SDavid du Colombier.I lp
581219b2ee8SDavid du Colombierand remove the job and id files which match the arguments
582219b2ee8SDavid du Colombierfor the particular queue.
583219b2ee8SDavid du ColombierWhen a job is killed, the generic kill procedure:
584219b2ee8SDavid du Colombier.IP 1)
585219b2ee8SDavid du Colombierkills the daemon for this queue if the job being killed
586219b2ee8SDavid du Colombieris first in the queue,
587219b2ee8SDavid du Colombier.IP 2)
588219b2ee8SDavid du Colombierremoves the files associated with the job from the queue,
589219b2ee8SDavid du Colombier.IP 3)
590219b2ee8SDavid du Colombierattempts to restart the daemon.
591219b2ee8SDavid du Colombier.NH 2
592219b2ee8SDavid du ColombierDaemon directory
593219b2ee8SDavid du Colombier.PP
594219b2ee8SDavid du ColombierThe
595219b2ee8SDavid du Colombier.CW daemon
596219b2ee8SDavid du Colombiershell scripts are the last to be invoked by
597219b2ee8SDavid du Colombier.I lp
598219b2ee8SDavid du Colombierif the
599219b2ee8SDavid du Colombier.CW -Q
600219b2ee8SDavid du Colombieroption has not been given.
601219b2ee8SDavid du ColombierThe daemon process is executed asynchronously
602219b2ee8SDavid du Colombierwith its standard output and standard error appended to
603219b2ee8SDavid du Colombierthe printer log file.
604219b2ee8SDavid du ColombierThe log file is described in a subsequent section.
605219b2ee8SDavid du ColombierBecause the daemon runs asynchronously, it must
606219b2ee8SDavid du Colombiercatch signals that could cause it to terminate abnormally.
607219b2ee8SDavid du ColombierThe daemon first checks to see that it is the only one running
608219b2ee8SDavid du Colombierby using the
609219b2ee8SDavid du Colombier.CW LOCK
610219b2ee8SDavid du Colombierprogram found in the
611219b2ee8SDavid du Colombier.CW /$cputype/bin/aux
612219b2ee8SDavid du Colombierdirectory.
613219b2ee8SDavid du ColombierThe
614219b2ee8SDavid du Colombier.CW LOCK
615219b2ee8SDavid du Colombiercommand creates a
616219b2ee8SDavid du Colombier.CW LOCK
617219b2ee8SDavid du Colombierfile in the printer's queue directory.
618219b2ee8SDavid du ColombierThe daemon then executes the scheduler to obtain the name of the
619219b2ee8SDavid du Colombiernext job on the queue.
620219b2ee8SDavid du Colombier.PP
621219b2ee8SDavid du ColombierThe processing of jobs may entail transfer to another host
622219b2ee8SDavid du Colombieror transmission to a printer.
623219b2ee8SDavid du ColombierThe details of this are specific to the individual daemons.
624219b2ee8SDavid du ColombierIf a job is processed without error, it is removed from the queue.
625219b2ee8SDavid du ColombierIf a job does not succeed, the associated files may be
626219b2ee8SDavid du Colombiermoved to a printer specific directory in
627219b2ee8SDavid du Colombier.CW $LPLIB/prob .
628219b2ee8SDavid du ColombierIn either case, the daemon can make an entry in the printer's
629219b2ee8SDavid du Colombierlog file.
630219b2ee8SDavid du ColombierBefore exiting, the daemon should clean up lock files by calling
631219b2ee8SDavid du Colombier.CW UNLOCK .
632219b2ee8SDavid du Colombier.PP
633219b2ee8SDavid du ColombierSeveral non-standard daemon programs have been designed
634219b2ee8SDavid du Colombierto suit various requirements and whims.
635219b2ee8SDavid du ColombierOne such program announces job completion and empty paper trays
636219b2ee8SDavid du Colombierby causing icons to appear in peoples'
637219b2ee8SDavid du Colombier.CW seemail
638219b2ee8SDavid du Colombierwindow.
639219b2ee8SDavid du ColombierAnother, using a voice synthesizer, makes verbal announcements.
640219b2ee8SDavid du ColombierOther daemons may be designed to taste.
641219b2ee8SDavid du Colombier.NH 2
642219b2ee8SDavid du ColombierSched directory
643219b2ee8SDavid du Colombier.PP
644219b2ee8SDavid du ColombierThe scheduler must decide which job files should be executed and
645219b2ee8SDavid du Colombierin what order.
646219b2ee8SDavid du ColombierThe most commonly used scheduler program is
647219b2ee8SDavid du Colombier.CW FIFO ,
648219b2ee8SDavid du Colombierwhich looks like this:
649219b2ee8SDavid du Colombier.P1
650219b2ee8SDavid du Colombierls -tr $* | sed -n -e 's/.*  *//' \e
651219b2ee8SDavid du Colombier  -e '/^[0-9][0-9]*\.[1-9][0-9]*$/p'
652219b2ee8SDavid du Colombier.P2
653219b2ee8SDavid du ColombierThis lists all the job files in this printer's queue in modification
654219b2ee8SDavid du Colombiertime order.
655219b2ee8SDavid du ColombierJobs entering the queue have a dot (.) prefixed to their name
656219b2ee8SDavid du Colombierto keep the scheduler from selecting them before they are complete.
657219b2ee8SDavid du Colombier.NH
6587dd7cddfSDavid du ColombierWhere Things Go Wrong
659219b2ee8SDavid du Colombier.PP
660219b2ee8SDavid du ColombierThere are four directories where
661219b2ee8SDavid du Colombier.I lp
662219b2ee8SDavid du Colombierwrites files.
663219b2ee8SDavid du ColombierOn the Plan 9 release these directories may be found
6647dd7cddfSDavid du Colombierin a directory on a scratch filesystem that is not
6657dd7cddfSDavid du Colombierbacked-up.
6667dd7cddfSDavid du ColombierThis directory is
6677dd7cddfSDavid du Colombier.CW /n/emelieother/lp .
6687dd7cddfSDavid du ColombierIt is built on top of a file system
6697dd7cddfSDavid du Colombier.CW other
6707dd7cddfSDavid du Colombierthat is mounted on the file server
6717dd7cddfSDavid du Colombier.CW emelie .
6727dd7cddfSDavid du ColombierThe four directories in
6737dd7cddfSDavid du Colombierthis scratch directory
6747dd7cddfSDavid du Colombierare
675219b2ee8SDavid du Colombier.CW log ,
676219b2ee8SDavid du Colombier.CW prob ,
677219b2ee8SDavid du Colombier.CW queue ,
678219b2ee8SDavid du Colombierand
679219b2ee8SDavid du Colombier.CW tmp .
680219b2ee8SDavid du Colombier.I Lp
681219b2ee8SDavid du Colombierbinds (see
682219b2ee8SDavid du Colombier.I bind (1))
683219b2ee8SDavid du Colombierthe first three into the directory
684219b2ee8SDavid du Colombier.CW /sys/lib/lp
685219b2ee8SDavid du Colombierfor its processes and their children.
686219b2ee8SDavid du ColombierThe
687219b2ee8SDavid du Colombier.CW tmp
688219b2ee8SDavid du Colombierdirectory is bound to the
689219b2ee8SDavid du Colombier.CW /tmp
690219b2ee8SDavid du Colombierdirectory so that the lp daemons, which run as user `none',
691219b2ee8SDavid du Colombiermay write into this directory.
6927dd7cddfSDavid du Colombier.PP
6937dd7cddfSDavid du ColombierOn any new installation, it is important that these directories
6947dd7cddfSDavid du Colombierbe set up and that the
6957dd7cddfSDavid du Colombier.I /rc/bin/lp
6967dd7cddfSDavid du Colombiercommand be editted to reflect the change.
6977dd7cddfSDavid du ColombierIf you do not have a scratch filesystem for these directories,
6987dd7cddfSDavid du Colombiercreate the four directories
6997dd7cddfSDavid du Colombier.CW log ,
7007dd7cddfSDavid du Colombier.CW prob ,
7017dd7cddfSDavid du Colombier.CW queue ,
7027dd7cddfSDavid du Colombierand
7037dd7cddfSDavid du Colombier.CW tmp
7047dd7cddfSDavid du Colombierin
7057dd7cddfSDavid du Colombier.CW $LPLIB
7067dd7cddfSDavid du Colombier.CW (/sys/lib/lp)
7077dd7cddfSDavid du Colombierso that they are writable by anyone.
708219b2ee8SDavid du Colombier.NH 2
709219b2ee8SDavid du ColombierLog directory
710219b2ee8SDavid du Colombier.PP
711219b2ee8SDavid du ColombierThe log files for a particular
712219b2ee8SDavid du Colombier.I printer
713219b2ee8SDavid du Colombierappear in a subdirectory of the spool directory
714219b2ee8SDavid du Colombier\f(CWlog\fP/\fIprinter\fP.
715219b2ee8SDavid du ColombierThere are currently two types of log files.
716219b2ee8SDavid du ColombierOne is for the daemon to log errors and successful completions
717219b2ee8SDavid du Colombierof jobs.
718219b2ee8SDavid du ColombierThese are named
719219b2ee8SDavid du Colombier.I printer.day
720219b2ee8SDavid du Colombierwhere
721219b2ee8SDavid du Colombier.I day
722219b2ee8SDavid du Colombieris the three letter abbreviation for the day of the week.
723219b2ee8SDavid du ColombierThese are overwritten once a week to avoid the need for regular
724219b2ee8SDavid du Colombiercleanup.
725219b2ee8SDavid du ColombierThe other type of log file contains the status of the printer and
726219b2ee8SDavid du Colombieris written by the program that communicates with the printer itself.
727219b2ee8SDavid du ColombierThese are named
728219b2ee8SDavid du Colombier\fIprinter\fP.\f(CWst\fP.
729219b2ee8SDavid du ColombierThese are overwritten with each new job and are saved in the
730219b2ee8SDavid du Colombier.CW $LPLIB/prob
731219b2ee8SDavid du Colombierdirectory along with the job under circumstances described below.
732219b2ee8SDavid du ColombierWhen a printer does not appear to be functioning these files are the
733219b2ee8SDavid du Colombierplace to look first.
734219b2ee8SDavid du Colombier.NH 2
735219b2ee8SDavid du ColombierProb directory
736219b2ee8SDavid du Colombier.PP
737219b2ee8SDavid du ColombierWhen a job fails to produce output,
738219b2ee8SDavid du Colombierthe log files should be checked for any obvious problems.
739219b2ee8SDavid du ColombierIf none can be found, a directory with full read and write permissions
740219b2ee8SDavid du Colombiershould be created with the name of the printer in the
741219b2ee8SDavid du Colombier.CW $LPLIB/prob
742219b2ee8SDavid du Colombierdirectory.
743219b2ee8SDavid du ColombierSubsequent failure of a job will cause the daemon to leave a
744219b2ee8SDavid du Colombiercopy of the job and the printer communication log in
745219b2ee8SDavid du Colombier\f(CW$LPLIB/prob/\fP\fIprinter\fP
746219b2ee8SDavid du Colombierdirectory.
747219b2ee8SDavid du ColombierIt is common for a printer to enter states from which
748219b2ee8SDavid du Colombierit cannot be rescued except by manually cycling the power on the printer.
749219b2ee8SDavid du ColombierAfter this is done the print daemon should recover by itself
750219b2ee8SDavid du Colombier(give it a minute).
751219b2ee8SDavid du ColombierIf it does not recover, remove the
752219b2ee8SDavid du Colombier.CW LOCK
753219b2ee8SDavid du Colombierfile from the printer's spool directory to kill the daemon.
754219b2ee8SDavid du ColombierThe daemon will have to be restarted by sending another job
755219b2ee8SDavid du Colombierto the printer.
756219b2ee8SDavid du ColombierFor PostScript printers just use:
757219b2ee8SDavid du Colombier.P1
758219b2ee8SDavid du Colombierecho '%!PS' | lp
759219b2ee8SDavid du Colombier.P2
760219b2ee8SDavid du Colombier.NH 2
761219b2ee8SDavid du ColombierRepairing Stuck Daemons
762219b2ee8SDavid du Colombier.PP
763219b2ee8SDavid du ColombierThere are conditions that occur which are not handled
764219b2ee8SDavid du Colombierby the daemons.
765219b2ee8SDavid du ColombierOne such problem can only be described as the printer entering a
766219b2ee8SDavid du Colombiercomatose state.
767219b2ee8SDavid du ColombierThe printer does not respond to any messages sent to it.
768219b2ee8SDavid du ColombierThe daemon should recover from the reset and an error message
769219b2ee8SDavid du Colombierwill appear in the log files.
770219b2ee8SDavid du ColombierIf all else fails, one can kill the first job in the queue
771219b2ee8SDavid du Colombieror remove the
772219b2ee8SDavid du Colombier.CW LOCK
773219b2ee8SDavid du Colombierfile from the queue directory.
774219b2ee8SDavid du ColombierThis will kill the daemon, which will have to be restarted.
775219b2ee8SDavid du Colombier.NH
776219b2ee8SDavid du ColombierInterprocessor Communication
777219b2ee8SDavid du Colombier.PP
778219b2ee8SDavid du ColombierA Plan 9 CPU server can be set up as a printer's spooling host.
779219b2ee8SDavid du ColombierThat is, the machine where jobs are spooled and from which those jobs
780219b2ee8SDavid du Colombierare sent directly to the printer.
781219b2ee8SDavid du ColombierTo do this, the CPU must listen on TCP port 515 which is the well known
782219b2ee8SDavid du Colombierport for the BSD line printer daemon.
783219b2ee8SDavid du ColombierThe file
784219b2ee8SDavid du Colombier.CW /rc/bin/service/tcp515
785219b2ee8SDavid du Colombieris executed when a call comes in on that port.
786219b2ee8SDavid du ColombierThe Plan 9
787219b2ee8SDavid du Colombier.CW lpdaemon
7887dd7cddfSDavid du Colombierwill accept jobs sent from BSD LPR/LPD systems.
789219b2ee8SDavid du ColombierThe
790219b2ee8SDavid du Colombier.CW /$cputype/bin/aux/lpdaemon
791219b2ee8SDavid du Colombiercommand is executed from the service call and it accepts print jobs, requests for status,
792219b2ee8SDavid du Colombierand requests to kill jobs.
793219b2ee8SDavid du ColombierThe command
794219b2ee8SDavid du Colombier.CW /$cputype/bin/aux/lpsend
795219b2ee8SDavid du Colombieris used to send jobs
796219b2ee8SDavid du Colombierto other Plan 9 machines and is usually called from
797219b2ee8SDavid du Colombierwithin a spooler or daemon script.
7987dd7cddfSDavid du ColombierThe command
7997dd7cddfSDavid du Colombier.CW /$cputype/bin/aux/lpdsend
8007dd7cddfSDavid du Colombieris used to send jobs
8017dd7cddfSDavid du Colombierto machines and printers that use the BSD LPR/LPD protocol and is also usually called from
8027dd7cddfSDavid du Colombierwithin a spooler or daemon script.
803219b2ee8SDavid du Colombier.NH
804219b2ee8SDavid du ColombierAcknowledgements
805219b2ee8SDavid du Colombier.PP
806219b2ee8SDavid du ColombierSpecial thanks to Rich Drechsler for supplying and maintaining most of
807219b2ee8SDavid du Colombierthe PostScript translation and interface programs,
808219b2ee8SDavid du Colombierwithout which
809219b2ee8SDavid du Colombier.I lp
810219b2ee8SDavid du Colombierwould be an empty shell.
811219b2ee8SDavid du ColombierTomas Rokicki provided the
812219b2ee8SDavid du ColombierTeX
813219b2ee8SDavid du Colombierto PostScript
814219b2ee8SDavid du Colombiertranslation program.
815219b2ee8SDavid du Colombier.NH
816219b2ee8SDavid du ColombierReferences
817219b2ee8SDavid du Colombier.LP
818219b2ee8SDavid du Colombier[Camp86] Ralph Campbell,
819219b2ee8SDavid du Colombier``4.3BSD Line Printer Spooler Manual'', UNIX System Manager's Manual,
820219b2ee8SDavid du ColombierMay, 1986, Berkeley, CA
821219b2ee8SDavid du Colombier.br
822219b2ee8SDavid du Colombier[RFC1179] Request for Comments: 1179, Line Printer Daemon Protocol, Aug 1990
823219b2ee8SDavid du Colombier.br
824219b2ee8SDavid du Colombier[Sys5] System V manual, date unknown
825