source: trunk/third/lprng/doc/LPRng-HOWTO-12.html @ 13098

Revision 13098, 22.9 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r13097, which included commits to RCS files with non-trunk default branches.
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2<HTML>
3<HEAD>
4 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5 <TITLE> LPRng-HOWTO: Job Processing</TITLE>
6 <LINK HREF="LPRng-HOWTO-13.html" REL=next>
7 <LINK HREF="LPRng-HOWTO-11.html" REL=previous>
8 <LINK HREF="LPRng-HOWTO.html#toc12" REL=contents>
9</HEAD>
10<BODY>
11<A HREF="LPRng-HOWTO-13.html">Next</A>
12<A HREF="LPRng-HOWTO-11.html">Previous</A>
13<A HREF="LPRng-HOWTO.html#toc12">Contents</A>
14<HR>
15<H2><A NAME="jobsteps"></A> <A NAME="s12">12. Job Processing</A></H2>
16
17<P>Much of the flexibility of the LPRng software is obtained
18from the ability to control the details of each step of job processing.
19The following section details each step in the processing of a job,
20and explains the printcap options used to control each operation.
21<P>Assume the <CODE>pr</CODE>
22printcap entry has the form:
23<BLOCKQUOTE><CODE>
24<PRE>
25pr
26    :lp=/dev/lp  OR  :lp=rp@rm
27    :sd=/var/spool/lpd/pr
28    :lf=log
29    :of=/usr/local/bin/lpf
30    :if=/usr/local/bin/lpf
31</PRE>
32</CODE></BLOCKQUOTE>
33<P>Assume that we have used the following command to print
34a set of files.
35<BLOCKQUOTE><CODE>
36<PRE>
37lpr -Ppr file1 file2
38</PRE>
39</CODE></BLOCKQUOTE>
40<P>This will create a control file
41in the
42<CODE>/var/spool/lpd/pr</CODE>
43directory with the following contents (this is an example -
44in practice there may be minor differences between the example
45and an actual control file):
46<BLOCKQUOTE><CODE>
47<PRE>
48Hastart4.astart.com
49J/tmp/file1 /tmp/file2
50CA
51Lpapowell
52Ppapowell
53fdfA002230astart4.astart.com
54N/tmp/file1
55UdfA002230astart4.astart.com
56fdfB002230astart4.astart.com
57N/tmp/file2
58UdfB002230astart4.astart.com
59</PRE>
60</CODE></BLOCKQUOTE>
61<P>
62<H2><A NAME="servertmpdir"></A> <A NAME="nb"></A> <A NAME="controlfilter"></A> <A NAME="connecttry"></A> <A NAME="connecttimeout"></A> <A NAME="connectinterval"></A> <A NAME="networkconnectgrace"></A> <A NAME="connectgrace"></A> <A NAME="rw"></A> <A NAME="ld"></A> <A NAME="ar"></A> <A NAME="la"></A> <A NAME="lpdev"></A> <A NAME="lk"></A> <A NAME="fo"></A> <A NAME="ff"></A> <A NAME="as"></A> <A NAME="af"></A> <A NAME="achk"></A> <A NAME="ss12.1">12.1 Opening the Output Device</A>
63</H2>
64
65<P>Options used:
66<UL>
67<LI> <CODE>achk</CODE><EM>&nbsp;&nbsp;Accounting check at start</EM></LI>
68<LI> <CODE>af=</CODE><EM>Accounting File</EM></LI>
69<LI> <CODE>ar</CODE><EM>&nbsp;&nbsp;Remote printer accounting enabled</EM></LI>
70<LI> <CODE>as=</CODE><EM>Accounting at start</EM></LI>
71<LI> <CODE>connect_grace#</CODE><EM>&nbsp;&nbsp;Time between jobs</EM></LI>
72<LI> <CODE>connect_interval#</CODE><EM>&nbsp;&nbsp;Connection interval</EM></LI>
73<LI> <CODE>connect_timeout#</CODE><EM>&nbsp;&nbsp;Connection timeout</EM></LI>
74<LI> <CODE>control_filter=</CODE><EM>Control file filter</EM></LI>
75<LI> <CODE>ff</CODE><EM>&nbsp;&nbsp;form feed</EM></LI>
76<LI> <CODE>fo</CODE><EM>&nbsp;&nbsp;form feed on open</EM></LI>
77<LI> <CODE>la</CODE><EM>&nbsp;&nbsp;Local printer accounting enabled</EM></LI>
78<LI> <CODE>ld=</CODE><EM>leader on open (initialization string)</EM></LI>
79<LI> <CODE>lk</CODE><EM>&nbsp;&nbsp;Lock IO device</EM></LI>
80<LI> <CODE>lp=</CODE><EM>IO device pathname</EM></LI>
81<LI> <CODE>nb</CODE><EM>&nbsp;&nbsp;Nonblocking device open</EM></LI>
82<LI> <CODE>network_connect_grace#</CODE><EM>&nbsp;&nbsp;Time between jobs</EM></LI>
83<LI> <CODE>of=</CODE><EM>of filter</EM></LI>
84<LI> <CODE>retry_econnrefused#</CODE><EM>&nbsp;&nbsp;Retry if open failed</EM></LI>
85<LI> <CODE>retry_nolink#</CODE><EM>&nbsp;&nbsp;Retry if open failed</EM></LI>
86<LI> <CODE>rm</CODE><EM>&nbsp;&nbsp;the remote machine to send the job to</EM></LI>
87<LI> <CODE>rp</CODE><EM>&nbsp;&nbsp;the remote print queue to send the job to</EM></LI>
88<LI> <CODE>rw</CODE><EM>&nbsp;&nbsp;device opened RW flag</EM></LI>
89<LI> <CODE>server_tmp_dir=</CODE><EM>temporary directory</EM></LI>
90</UL>
91
92Sequence of Operations:
93<OL>
94<LI>During the server operations,
95it will try to create temporary files in the print queue spool directory.
96If this is not desirable,
97it will create them in the <CODE>server_tmp_dir</CODE> directory.</LI>
98<LI>If the accounting file specified by
99<CODE>af</CODE>
100exists,
101it is opened (af_fd) and the af_fd is passed as file descriptor
1023 to all filters.
103If the <CODE>af</CODE> value has the form <CODE>af=|/program</CODE>
104then the program is started and the program STDIN is used as af_fd.
105If the <CODE>af</CODE> value has the form <CODE>af=host%port</CODE>,
106then a TCP/IP connection to the corresponding port on the remote host
107is made and the port used as af_fd.
108In the latter two cases,  the filter STDIN (file descriptor 0)
109is actually opened read/write, and is used when information is needed
110from the accounting filter or remote server.
111See
112<A HREF="LPRng-HOWTO-15.html#accountingserver">Accounting Printcap Options</A>
113for more information on the LPRng accounting support.</LI>
114<LI>If the
115<CODE>connect_grace</CODE>
116value is non-zero and the server is opening a device or
117<CODE>network_connect_grace</CODE> is non-zero and a network connection
118is being made,
119the server will pause the specified time.
120This is to accommodate devices which need a recovery time between jobs.</LI>
121<LI>The <CODE>lp</CODE> option is checked to determine the type of IO device.
122<CENTER><TABLE BORDER><TR><TD>
123<BR>
124Format</TD><TD>Meaning</TD></TR><TR><TD>
125<CODE>/pathname</CODE></TD><TD>Absolute pathname of IO device</TD></TR><TR><TD>
126<CODE>pr@host</CODE></TD><TD>transfer to <CODE>pr</CODE> on remote <CODE>host</CODE></TD></TR><TR><TD>
127<CODE>host%port</CODE></TD><TD>open a TCP/IP connection to port on host. host can be name or IP address</TD></TR><TR><TD>
128<CODE>|filter</CODE></TD><TD>run the filter program; it STDIN will be used as device</TD></TR><TR><TD>
129
130</TD></TR></TABLE></CENTER>
131</LI>
132<LI>The IO device specified by
133<CODE>lp</CODE> is opened write-only or read-write if the
134<CODE>rw</CODE>
135flag is true, and the resulting file descriptor is io_fd.
136If the <CODE>nb</CODE> flag is set,
137a non-blocking open will be done as well.
138If the <CODE>lk</CODE> (lock device) flag is true,
139the device will be locked against use by other LPD servers.</LI>
140<LI>If a <CODE>host%port</CODE> combination,
141a TCP/IP connection will be opened to the remote port and the connection will
142be used as io_fd.</LI>
143<LI>If a filter program is specified,
144the filter program will be run and the STDIN of the filter will be
145used as the device file descriptor.</LI>
146<LI>If a <CODE>rp@rm</CODE> combination,
147or none of the above combinations are true and the
148<CODE>rm</CODE> and <CODE>rp</CODE> values are non-zero,
149then the job will be transferred to a remote printer.
150The type of operation will be a job transfer,
151rather than printing operation.</LI>
152<LI>If the <CODE>connect_timeout</CODE> value is non-zero,
153a timeout is setup for the device or socket open.
154If the device or connection open does not succeed within the timeout,
155then the open operation fails.</LI>
156<LI>If a connection is to a network address
157(i.e. - <CODE>connect()</CODE> system call)
158and the connection attempt fails with an <CODE>ECONNREFUSED</CODE>
159error,
160if the <CODE>retry_econnrefused</CODE>
161flag is set then the connection attempt is retried,
162but this time using an alternative port number.
163See
164<A HREF="LPRng-HOWTO-18.html#rfc1179ref">RFC1179</A> for details.
165This is repeated until all of the possible originating port numbers
166are exhausted.</LI>
167<LI>If the open or connect operation fails,
168and the <CODE>retry_nolink</CODE> flag is set,
169then the server will pause for a minimum of
170<CODE>connect_grace</CODE> plus a multiple of
171<CODE>connect_interval</CODE> seconds
172based on the number of attempts
173before retrying the open operation.
174Note that the interval may increase as the number of attempts
175increases.</LI>
176<LI>If printing a job and the
177<CODE>of</CODE> filter is specified,
178it is created with its STDOUT (fd 1) attached to the io_fd.
179Its stdin (of_fd) will be used in the steps listed below.
180If there is no
181<CODE>of</CODE> filter,
182then the of_fd value will be the io_fd descriptor.</LI>
183<LI>If transferring a job and the <CODE>control_filter</CODE> option is specified,
184then the program specified by the <CODE>control_filter</CODE>
185value will be run. It will have its STDIN set to the control file,
186and its STDOUT output will be used as the new value of the control file
187to transfer to the remote host.
188See
189<A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A>
190for details of options passed to the control filter,
191and
192<A HREF="#errorcodes">errorcodes</A> for the exit codes of the filter.</LI>
193<LI>
194<A NAME="accountstart"></A> 
195If <CODE>la</CODE> (local accounting) is true and we are printing a job
196or <CODE>ar</CODE> (remote accounting) is true and we are transferring a job,
197the <CODE>as</CODE> value is examined.
198If it is a filter (program) specification,
199then the program is started with its STDIN attached to
200<CODE>/dev/null</CODE> and STDOUT to the io_fd,
201STDERR to the error file,
202and file descriptor 3 to the accounting file descriptor af_fd.
203The lpd program will wait until it terminates,
204and examine the error code for action, as for the filters
205(see
206<A HREF="#errorcodes">errorcodes</A> below).
207If it is a string,
208then it is interpreted, the escape sequences replaced with the appropriate
209information,  and written to the accounting file.</LI>
210<LI>If the <CODE>achk</CODE> (accounting check) flag is set,
211a line is read from the accounting filter af_fd file descriptor.
212This line should be <CODE>accept</CODE>,
213otherwise the job processing terminates with a JFAIL indication.</LI>
214<LI>If the operation is a job transfer, the operation proceeds as outlined in
215<A HREF="LPRng-HOWTO-18.html#rfc1179ref">RFC1179</A>,
216and then the
217<A HREF="#normalterm">Normal Termination</A> operations are
218carried out.</LI>
219<LI>If the operation is a print operation
220and the
221<CODE>ld</CODE> (leader on open) value is provided,
222the string
223is translated (escapes removed)
224and written to the of_fd file descriptor.</LI>
225<LI>If the
226<CODE>fo</CODE> (form feed on open) flag is true, then the
227<CODE>ff</CODE> (form feed) string
228is translated (escapes removed)
229and written to the of_fd file descriptor.</LI>
230</OL>
231<H2><A NAME="bannerprinting"></A> <A NAME="of"></A> <A NAME="sh"></A> <A NAME="sb"></A> <A NAME="bs"></A> <A NAME="bp"></A> <A NAME="bl"></A> <A NAME="be"></A> <A NAME="hl"></A> <A NAME="ab"></A> <A NAME="ss12.2">12.2 Printing Banner At Beginning</A>
232</H2>
233
234<P>Options used:
235<UL>
236<LI> <CODE>ab</CODE><EM>&nbsp;&nbsp;Always print banner (default FALSE)</EM></LI>
237<LI> <CODE>be=</CODE><EM>End banner generator program</EM></LI>
238<LI> <CODE>bl=</CODE><EM>Short banner line format</EM></LI>
239<LI> <CODE>bp=</CODE><EM>Banner generator program</EM></LI>
240<LI> <CODE>bs=</CODE><EM>Start banner generator</EM></LI>
241<LI> <CODE>hl</CODE><EM>&nbsp;&nbsp;Banner (header) Last</EM></LI>
242<LI> <CODE>of=</CODE><EM>Banner and File Separator Filter</EM></LI>
243<LI> <CODE>sb</CODE><EM>&nbsp;&nbsp;Short banner (default FALSE)</EM></LI>
244<LI> <CODE>sh</CODE><EM>&nbsp;&nbsp;Suppress header (banners) (default FALSE)</EM></LI>
245</UL>
246
247Sequence of Operations:
248<OL>
249<LI>If the
250<CODE>sh</CODE> (suppress header) flag is true, no banner is
251printed,
252and the actions in this section are skipped.</LI>
253<LI>If the <CODE>hl</CODE> (header last) flag is true, the banner is printed at the end
254of the job,
255and the actions in this section are skipped.</LI>
256<LI>If the user does not want banner pages and uses
257<CODE>lpr -h </CODE>
258then the <CODE>L</CODE> line in the control file will be missing.
259This is a signal not to print a banner.
260If there is no <CODE>L</CODE> line in the control file
261and
262<CODE>ab</CODE> (always print a banner) is false
263(the default),
264then no banner is printed.
265If there is no <CODE>L</CODE> line and
266<CODE>ab</CODE> is true, then ANONYMOUS is used.</LI>
267<LI>LPRng generates banners by using
268either a banner printing program specified by <CODE>bp</CODE>, tt<CODE>bs</CODE>,
269or <CODE>be</CODE> options.
270For historical compatibility,
271if the <CODE>sb</CODE> flag is set, then the
272<CODE>bl</CODE>
273(banner line) contents  are sent directly to the of_fd;
274By default the
275<CODE>bl</CODE> value is:
276<CODE>bl=$-'C:$-'n Job: $-'J Date: $-'t</CODE>
277(See
278<A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A>
279for details.)
280This will get translated to:<BR>
281<CODE>papowell:A Job: file1 file2 Date: Thu Nov 27 23:02:04 PST 1997</CODE></LI>
282<LI>If
283<CODE>bs</CODE> (start banner) program is specified, then it is used
284to generate a banner,
285otherwise if the
286<CODE>bp</CODE> (banner) program is specified, then it is used
287to generate a banner.
288If no program is available, we skip the banner generation.
289The banner generator program is started with the normal command line
290flags
291(see
292<A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A>),
293with its STDOUT attached to the of_fd descriptor.
294The short banner string described in the previous step is written
295to the STDIN.
296The banner printer is responsible for generating a banner
297appropriate to the printing device.</LI>
298</OL>
299<H2><A NAME="format"></A> <A NAME="sf"></A> <A NAME="sendqueryrwtimeout"></A> <A NAME="sendjobrwtimeout"></A> <A NAME="ss12.3">12.3 Printing Job Files</A>
300</H2>
301
302<P>Options used:
303<UL>
304<LI> <CODE>Xf=</CODE><EM>Format Filter</EM></LI>
305<LI> <CODE>if=</CODE><EM>Default F Format Filter</EM></LI>
306<LI> <CODE>pr=</CODE><EM>pr formatting program</EM></LI>
307<LI> <CODE>send_job_rw_timeout=</CODE><EM> print job read/write timeout </EM></LI>
308<LI> <CODE>send_query_rw_timeout=</CODE><EM> status query operation read/write timeout </EM></LI>
309<LI> <CODE>sf</CODE><EM>&nbsp;&nbsp;Suppress FF Print File Separators</EM></LI>
310</UL>
311<P>Sequence of Operations:
312for each job in listed in the control file,
313the following operations are done in turn.
314<OL>
315<LI>If there is an <CODE>of</CODE> filter present,
316the suspend string <CODE>\031\001</CODE> is written to of_fd
317and the no further action is taken until the of filter is suspended.</LI>
318<LI>The control file line for the job is examined,
319and the first letter of the data file specification is used as the format.</LI>
320<LI>If the format is
321<CODE>p</CODE>,
322the job is first processed by the program specified by the
323<CODE>pr</CODE>
324program,
325and the program output used as the print file.</LI>
326<LI>If the format is
327<CODE>f</CODE>,
328<CODE>l</CODE>,
329or
330<CODE>p</CODE>
331then the <CODE>if</CODE> filter is used,
332otherwise the keyword
333<CODE>Xf</CODE> is used.
334Note that certain formats such as
335<CODE>p, a, l</CODE>, may not be used as formats.</LI>
336<LI>The filter program is started with an appropriate set of command line options
337(see
338<A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A>),
339and with its STDOUT attached to the printing device (io_fd),
340STDERR to the log file (<CODE>lf</CODE>),
341and file descriptor 3 to the accounting fd af_fd.</LI>
342<LI>When doing a read/write operation to a device or remote system,
343a timeout can be specified.
344When doing a print or job transfer operation,
345the <CODE>send_job_rw_timeout</CODE> value is used.
346When doing a status or query operation,
347the <CODE>send_query_rw_timeout</CODE> value is used.
348If a write or write operation does not complete within
349the specified timeout seconds, then we have an error
350condition and job processing or the query operation
351is terminated with JFAIL status.
352If the timeout value is 0, then no timeout is done.</LI>
353<LI>
354<A NAME="errorcodes"></A> 
355<CODE>lpd</CODE> will then wait for the filter to exit.
356The exit status can be as follows:
357<BLOCKQUOTE><CODE>
358<PRE>
359Key      Value   Meaning
360JSUCC    0       Successful
361JFAIL    1, 32   Failed - retry later
362JABORT   2, 33   Abort - terminate queue processing
363JREMOVE  3, 34   Failed - remove job
364JHOLD    6, 37   Failed - hold this job
365Other            Abort - terminate queue processing
366</PRE>
367</CODE></BLOCKQUOTE>
368</LI>
369<LI>If the filter exit status was JSUCC (0), or no error indicated,
370then processing will continue otherwise the job termination takes
371(see
372<A HREF="#termination">Abnormal Termination</A>).</LI>
373<LI>If the <CODE>of</CODE> filter is present,
374then it is reactivated with a <CODE>kill -CONT</CODE> signal.</LI>
375<LI>If the <CODE>sf</CODE> (suppress FF print file separators ) is false,
376then the
377<CODE>ff</CODE> (form feed) string
378will be interpreted and sent to the of_fd.</LI>
379</OL>
380<H2><A NAME="ss12.4">12.4 Printing Banner At End</A>
381</H2>
382
383<P>Options used:
384<UL>
385<LI> <CODE>hl</CODE><EM>&nbsp;&nbsp;Header (Banner) Last</EM></LI>
386</UL>
387<P>The actions taken in this step are identical to those for the
388<A HREF="#bp">Printing Banner At Beginning</A>,
389with the exception that the
390<CODE>be</CODE> (end banner program) is used to select the banner generation program
391rather than the
392<CODE>bs</CODE> (start banner program).
393<P>If we have <CODE>hl</CODE> true,
394then we print a banner at the end of the job,
395rather than start.
396<P>
397<H2><A NAME="normalterm"></A> <A NAME="tr"></A> <A NAME="savewhendone"></A> <A NAME="fq"></A> <A NAME="ae"></A> <A NAME="ss12.5">12.5 Normal Termination</A>
398</H2>
399
400<P>Options used:
401<UL>
402<LI> <CODE>fq</CODE><EM>&nbsp;&nbsp;Form Feed on Close</EM></LI>
403<LI> <CODE>la</CODE><EM>&nbsp;&nbsp;Local Printer Accounting</EM></LI>
404<LI> <CODE>tr=</CODE><EM>Trailer on Close</EM></LI>
405<LI> <CODE>ae=</CODE><EM>Accounting at end</EM></LI>
406<LI> <CODE>save_when_done</CODE><EM>&nbsp;&nbsp;Save when done</EM></LI>
407</UL>
408<P>Sequence of Operations:
409<OL>
410<LI>If we are printing and the <CODE>fq</CODE> flag is set and the
411<CODE>sf</CODE> (suppress interfile FF) flag is set,
412then the
413<CODE>ff</CODE> (form feed) string
414will be interpreted and sent to the of_fd.</LI>
415<LI>If we are printing, the <CODE>tr</CODE> (trailer) string
416will be interpreted and sent to the of_fd.</LI>
417<LI>If printing and the <CODE>la</CODE> (local printer accounting) flag is set
418or transferring a job and the <CODE>ar</CODE> (remote accounting) flag is set,
419the
420<CODE>ae</CODE> is examined and accounting is done as described
421for the
422<CODE>
423<A HREF="#accountstart">as</A> field.</CODE></LI>
424<LI>If the <CODE>of</CODE> filter is present,
425its STDIN is closed,
426and the <CODE>lpd</CODE> server waits for it to exit.
427The exit status is used as described above.</LI>
428<LI>The device (io_fd) is closed.</LI>
429<LI>The job is marked as completed in the spool queue.</LI>
430<LI>If the <CODE>save_when_done</CODE> flag is not specified,
431the job is removed.</LI>
432</OL>
433<H2><A NAME="termination"></A> <A NAME="maxconnectinterval"></A> <A NAME="stoponabort"></A> <A NAME="sendmail"></A> <A NAME="mailoperatoronerror"></A> <A NAME="mailfrom"></A> <A NAME="sendfailureaction"></A> <A NAME="sendtry"></A> <A NAME="saveonerror"></A> <A NAME="ss12.6">12.6 Abnormal Termination</A>
434</H2>
435
436<P>Options used:
437<UL>
438<LI> <CODE>mail_from=</CODE><EM>Mail from user name</EM></LI>
439<LI> <CODE>mail_operator_on_error=</CODE><EM>Mail to operator on error</EM></LI>
440<LI> <CODE>send_try#</CODE><EM>&nbsp;&nbsp;Maximum Print or Transfer Attempts</EM></LI>
441<LI> <CODE>save_on_error</CODE><EM>&nbsp;&nbsp;Do not delete on error</EM></LI>
442<LI> <CODE>send_failure_action=</CODE><EM>Action on Failure</EM></LI>
443<LI> <CODE>sendmail=</CODE><EM>sendmail path name and options</EM></LI>
444<LI> <CODE>stop_on_abort</CODE><EM>&nbsp;&nbsp;Stop processing queue on filter abort</EM></LI>
445</UL>
446<P>If the job processing terminates abnormally,
447the following sequence of events occurs:
448<OL>
449<LI>The job is marked as having an error during processing.</LI>
450<LI>The LPD server will attempt to kill all filters and other associated process
451by using a sequence of
452<CODE>kill -INT</CODE>,
453<CODE>kill -QUIT</CODE>,
454and finally
455<CODE>kill -KILL</CODE> operations.</LI>
456<LI>If there is a <CODE>mail_operator_on_error</CODE> value,
457the specified operator will be mailed an error indication.
458The <CODE>sendmail</CODE> option specifies the pathname of the
459<EM>sendmail</EM> program and the options needed to have it read
460mail addresses from its standard input.
461For example, <CODE>sendmail=/usr/sbin/sendmail -oi -t</CODE>
462is a commonly used set of options.</LI>
463<LI>The <CODE>mail_from</CODE> value specifies the user name used for
464mail origination.  If not specified, the default is to use the print spool
465queue or printer name.</LI>
466<LI>If there is a <CODE>send_failure_action</CODE> specified,
467then it is decoded and the corresponding action taken.
468If the value is
469<CODE>remove</CODE>,
470<CODE>hold</CODE>,
471<CODE>abort</CODE>,
472or
473<CODE>retry</CODE>,
474then the job is removed, held, aborted, or retried.
475If the value is <CODE>|/program</CODE>,
476the program is executed and
477the number of attempts are written to the filter STDIN.
478The exit status of the filter will be used to determine the consequent actions.
479That is, JSUCC (0) will be success, and the standard success action will
480be taken;
481JFAIL will cause retry,
482JREMOVE will cause the job to be removed,
483JHOLD will cause the job to be held,
484JABORT or other status will abort processing.</LI>
485<LI>If the status is ABORT and the
486<CODE>stop_on_abort</CODE>
487flag is set,
488then further processing of jobs is terminated.
489The job is not removed from the queue.</LI>
490<LI>If the error status indicates removal,
491and the <CODE>save_on_error</CODE> flag is clear
492then the job is removed from the spool queue.</LI>
493<LI>If the error status indicates that no further operations should
494be performed on the queue,
495then the <CODE>lpd</CODE> server will stop processing jobs.</LI>
496<LI>If the error code indicated that the job should be retried,
497and the
498<CODE>send_try</CODE> value is 0 or the number of attempts is less than
499the <CODE>send_try</CODE> value,
500then the job is retried.
501Between each attempt to transfer a job to a remote site.
502This pause will double after each attempt,
503reaching a maximum of <CODE>max_connect_interval</CODE> seconds.
504If <CODE>max_connect_interval</CODE> is 0, there is no limit on the interval value.</LI>
505</OL>
506<H2><A NAME="maxserversactive"></A> <A NAME="lpdpolltime"></A> <A NAME="lpdforcepoll"></A> <A NAME="ss12.7">12.7 LPD Spool Queue Processing</A>
507</H2>
508
509<P>Options used:
510<UL>
511<LI> <CODE>lpd_force_poll=</CODE><EM>Force LPD to periodically poll print queues </EM></LI>
512<LI> <CODE>lpd_poll_time#</CODE><EM>Time between polls</EM></LI>
513<LI> <CODE>max_servers_active#</CODE><EM>Maximum number of active servers</EM></LI>
514</UL>
515<P>When the <CODE>lpd</CODE> server starts,
516it will fork a set of subserver processes,
517each which will handle an individual queue.
518<P>If a system has a large number of queues,
519then this forking operation may result in the <CODE>lpd</CODE> server
520exhausting the process resources.
521To control this,  the
522<CODE>max_servers_active</CODE> value restricts the number of active
523children to the specified value.
524If this value is 0,
525then 50% of the maximum system processes value will be used.
526<P>Due to the limits on the number of processes,
527there may be times when a job is placed in a queue,
528but the <CODE>lpd</CODE> server is unable to start handling the job.
529When all of the children of the main <CODE>lpd</CODE> server have
530exited,
531the server starts a timer.
532After <CODE>lpd_poll_time</CODE> seconds,  it will scan the queues,
533looking for jobs to process,
534and starts a process to service them.
535If it does not find any jobs it remains idle.
536<P>The <CODE>lpd_force_poll</CODE> flag causes the server to periodically
537poll the queues.
538This is useful when there is a high possibility that jobs could fail to be
539printed due to high loads on the server.
540<HR>
541<A HREF="LPRng-HOWTO-13.html">Next</A>
542<A HREF="LPRng-HOWTO-11.html">Previous</A>
543<A HREF="LPRng-HOWTO.html#toc12">Contents</A>
544</BODY>
545</HTML>
Note: See TracBrowser for help on using the repository browser.