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 |
---|
18 | from the ability to control the details of each step of job processing. |
---|
19 | The following section details each step in the processing of a job, |
---|
20 | and explains the printcap options used to control each operation. |
---|
21 | <P>Assume the <CODE>pr</CODE> |
---|
22 | printcap entry has the form: |
---|
23 | <BLOCKQUOTE><CODE> |
---|
24 | <PRE> |
---|
25 | pr |
---|
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 |
---|
34 | a set of files. |
---|
35 | <BLOCKQUOTE><CODE> |
---|
36 | <PRE> |
---|
37 | lpr -Ppr file1 file2 |
---|
38 | </PRE> |
---|
39 | </CODE></BLOCKQUOTE> |
---|
40 | <P>This will create a control file |
---|
41 | in the |
---|
42 | <CODE>/var/spool/lpd/pr</CODE> |
---|
43 | directory with the following contents (this is an example - |
---|
44 | in practice there may be minor differences between the example |
---|
45 | and an actual control file): |
---|
46 | <BLOCKQUOTE><CODE> |
---|
47 | <PRE> |
---|
48 | Hastart4.astart.com |
---|
49 | J/tmp/file1 /tmp/file2 |
---|
50 | CA |
---|
51 | Lpapowell |
---|
52 | Ppapowell |
---|
53 | fdfA002230astart4.astart.com |
---|
54 | N/tmp/file1 |
---|
55 | UdfA002230astart4.astart.com |
---|
56 | fdfB002230astart4.astart.com |
---|
57 | N/tmp/file2 |
---|
58 | UdfB002230astart4.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> Accounting check at start</EM></LI> |
---|
68 | <LI> <CODE>af=</CODE><EM>Accounting File</EM></LI> |
---|
69 | <LI> <CODE>ar</CODE><EM> Remote printer accounting enabled</EM></LI> |
---|
70 | <LI> <CODE>as=</CODE><EM>Accounting at start</EM></LI> |
---|
71 | <LI> <CODE>connect_grace#</CODE><EM> Time between jobs</EM></LI> |
---|
72 | <LI> <CODE>connect_interval#</CODE><EM> Connection interval</EM></LI> |
---|
73 | <LI> <CODE>connect_timeout#</CODE><EM> Connection timeout</EM></LI> |
---|
74 | <LI> <CODE>control_filter=</CODE><EM>Control file filter</EM></LI> |
---|
75 | <LI> <CODE>ff</CODE><EM> form feed</EM></LI> |
---|
76 | <LI> <CODE>fo</CODE><EM> form feed on open</EM></LI> |
---|
77 | <LI> <CODE>la</CODE><EM> 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> Lock IO device</EM></LI> |
---|
80 | <LI> <CODE>lp=</CODE><EM>IO device pathname</EM></LI> |
---|
81 | <LI> <CODE>nb</CODE><EM> Nonblocking device open</EM></LI> |
---|
82 | <LI> <CODE>network_connect_grace#</CODE><EM> Time between jobs</EM></LI> |
---|
83 | <LI> <CODE>of=</CODE><EM>of filter</EM></LI> |
---|
84 | <LI> <CODE>retry_econnrefused#</CODE><EM> Retry if open failed</EM></LI> |
---|
85 | <LI> <CODE>retry_nolink#</CODE><EM> Retry if open failed</EM></LI> |
---|
86 | <LI> <CODE>rm</CODE><EM> the remote machine to send the job to</EM></LI> |
---|
87 | <LI> <CODE>rp</CODE><EM> the remote print queue to send the job to</EM></LI> |
---|
88 | <LI> <CODE>rw</CODE><EM> device opened RW flag</EM></LI> |
---|
89 | <LI> <CODE>server_tmp_dir=</CODE><EM>temporary directory</EM></LI> |
---|
90 | </UL> |
---|
91 | |
---|
92 | Sequence of Operations: |
---|
93 | <OL> |
---|
94 | <LI>During the server operations, |
---|
95 | it will try to create temporary files in the print queue spool directory. |
---|
96 | If this is not desirable, |
---|
97 | it will create them in the <CODE>server_tmp_dir</CODE> directory.</LI> |
---|
98 | <LI>If the accounting file specified by |
---|
99 | <CODE>af</CODE> |
---|
100 | exists, |
---|
101 | it is opened (af_fd) and the af_fd is passed as file descriptor |
---|
102 | 3 to all filters. |
---|
103 | If the <CODE>af</CODE> value has the form <CODE>af=|/program</CODE> |
---|
104 | then the program is started and the program STDIN is used as af_fd. |
---|
105 | If the <CODE>af</CODE> value has the form <CODE>af=host%port</CODE>, |
---|
106 | then a TCP/IP connection to the corresponding port on the remote host |
---|
107 | is made and the port used as af_fd. |
---|
108 | In the latter two cases, the filter STDIN (file descriptor 0) |
---|
109 | is actually opened read/write, and is used when information is needed |
---|
110 | from the accounting filter or remote server. |
---|
111 | See |
---|
112 | <A HREF="LPRng-HOWTO-15.html#accountingserver">Accounting Printcap Options</A> |
---|
113 | for more information on the LPRng accounting support.</LI> |
---|
114 | <LI>If the |
---|
115 | <CODE>connect_grace</CODE> |
---|
116 | value is non-zero and the server is opening a device or |
---|
117 | <CODE>network_connect_grace</CODE> is non-zero and a network connection |
---|
118 | is being made, |
---|
119 | the server will pause the specified time. |
---|
120 | This 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> |
---|
124 | Format</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> |
---|
135 | flag is true, and the resulting file descriptor is io_fd. |
---|
136 | If the <CODE>nb</CODE> flag is set, |
---|
137 | a non-blocking open will be done as well. |
---|
138 | If the <CODE>lk</CODE> (lock device) flag is true, |
---|
139 | the device will be locked against use by other LPD servers.</LI> |
---|
140 | <LI>If a <CODE>host%port</CODE> combination, |
---|
141 | a TCP/IP connection will be opened to the remote port and the connection will |
---|
142 | be used as io_fd.</LI> |
---|
143 | <LI>If a filter program is specified, |
---|
144 | the filter program will be run and the STDIN of the filter will be |
---|
145 | used as the device file descriptor.</LI> |
---|
146 | <LI>If a <CODE>rp@rm</CODE> combination, |
---|
147 | or none of the above combinations are true and the |
---|
148 | <CODE>rm</CODE> and <CODE>rp</CODE> values are non-zero, |
---|
149 | then the job will be transferred to a remote printer. |
---|
150 | The type of operation will be a job transfer, |
---|
151 | rather than printing operation.</LI> |
---|
152 | <LI>If the <CODE>connect_timeout</CODE> value is non-zero, |
---|
153 | a timeout is setup for the device or socket open. |
---|
154 | If the device or connection open does not succeed within the timeout, |
---|
155 | then the open operation fails.</LI> |
---|
156 | <LI>If a connection is to a network address |
---|
157 | (i.e. - <CODE>connect()</CODE> system call) |
---|
158 | and the connection attempt fails with an <CODE>ECONNREFUSED</CODE> |
---|
159 | error, |
---|
160 | if the <CODE>retry_econnrefused</CODE> |
---|
161 | flag is set then the connection attempt is retried, |
---|
162 | but this time using an alternative port number. |
---|
163 | See |
---|
164 | <A HREF="LPRng-HOWTO-18.html#rfc1179ref">RFC1179</A> for details. |
---|
165 | This is repeated until all of the possible originating port numbers |
---|
166 | are exhausted.</LI> |
---|
167 | <LI>If the open or connect operation fails, |
---|
168 | and the <CODE>retry_nolink</CODE> flag is set, |
---|
169 | then the server will pause for a minimum of |
---|
170 | <CODE>connect_grace</CODE> plus a multiple of |
---|
171 | <CODE>connect_interval</CODE> seconds |
---|
172 | based on the number of attempts |
---|
173 | before retrying the open operation. |
---|
174 | Note that the interval may increase as the number of attempts |
---|
175 | increases.</LI> |
---|
176 | <LI>If printing a job and the |
---|
177 | <CODE>of</CODE> filter is specified, |
---|
178 | it is created with its STDOUT (fd 1) attached to the io_fd. |
---|
179 | Its stdin (of_fd) will be used in the steps listed below. |
---|
180 | If there is no |
---|
181 | <CODE>of</CODE> filter, |
---|
182 | then 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, |
---|
184 | then the program specified by the <CODE>control_filter</CODE> |
---|
185 | value will be run. It will have its STDIN set to the control file, |
---|
186 | and its STDOUT output will be used as the new value of the control file |
---|
187 | to transfer to the remote host. |
---|
188 | See |
---|
189 | <A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A> |
---|
190 | for details of options passed to the control filter, |
---|
191 | and |
---|
192 | <A HREF="#errorcodes">errorcodes</A> for the exit codes of the filter.</LI> |
---|
193 | <LI> |
---|
194 | <A NAME="accountstart"></A> |
---|
195 | If <CODE>la</CODE> (local accounting) is true and we are printing a job |
---|
196 | or <CODE>ar</CODE> (remote accounting) is true and we are transferring a job, |
---|
197 | the <CODE>as</CODE> value is examined. |
---|
198 | If it is a filter (program) specification, |
---|
199 | then the program is started with its STDIN attached to |
---|
200 | <CODE>/dev/null</CODE> and STDOUT to the io_fd, |
---|
201 | STDERR to the error file, |
---|
202 | and file descriptor 3 to the accounting file descriptor af_fd. |
---|
203 | The lpd program will wait until it terminates, |
---|
204 | and examine the error code for action, as for the filters |
---|
205 | (see |
---|
206 | <A HREF="#errorcodes">errorcodes</A> below). |
---|
207 | If it is a string, |
---|
208 | then it is interpreted, the escape sequences replaced with the appropriate |
---|
209 | information, and written to the accounting file.</LI> |
---|
210 | <LI>If the <CODE>achk</CODE> (accounting check) flag is set, |
---|
211 | a line is read from the accounting filter af_fd file descriptor. |
---|
212 | This line should be <CODE>accept</CODE>, |
---|
213 | otherwise 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>, |
---|
216 | and then the |
---|
217 | <A HREF="#normalterm">Normal Termination</A> operations are |
---|
218 | carried out.</LI> |
---|
219 | <LI>If the operation is a print operation |
---|
220 | and the |
---|
221 | <CODE>ld</CODE> (leader on open) value is provided, |
---|
222 | the string |
---|
223 | is translated (escapes removed) |
---|
224 | and 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 |
---|
228 | is translated (escapes removed) |
---|
229 | and 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> 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> Banner (header) Last</EM></LI> |
---|
242 | <LI> <CODE>of=</CODE><EM>Banner and File Separator Filter</EM></LI> |
---|
243 | <LI> <CODE>sb</CODE><EM> Short banner (default FALSE)</EM></LI> |
---|
244 | <LI> <CODE>sh</CODE><EM> Suppress header (banners) (default FALSE)</EM></LI> |
---|
245 | </UL> |
---|
246 | |
---|
247 | Sequence of Operations: |
---|
248 | <OL> |
---|
249 | <LI>If the |
---|
250 | <CODE>sh</CODE> (suppress header) flag is true, no banner is |
---|
251 | printed, |
---|
252 | and 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 |
---|
254 | of the job, |
---|
255 | and 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> |
---|
258 | then the <CODE>L</CODE> line in the control file will be missing. |
---|
259 | This is a signal not to print a banner. |
---|
260 | If there is no <CODE>L</CODE> line in the control file |
---|
261 | and |
---|
262 | <CODE>ab</CODE> (always print a banner) is false |
---|
263 | (the default), |
---|
264 | then no banner is printed. |
---|
265 | If 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 |
---|
268 | either a banner printing program specified by <CODE>bp</CODE>, tt<CODE>bs</CODE>, |
---|
269 | or <CODE>be</CODE> options. |
---|
270 | For historical compatibility, |
---|
271 | if the <CODE>sb</CODE> flag is set, then the |
---|
272 | <CODE>bl</CODE> |
---|
273 | (banner line) contents are sent directly to the of_fd; |
---|
274 | By 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> |
---|
279 | for details.) |
---|
280 | This 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 |
---|
284 | to generate a banner, |
---|
285 | otherwise if the |
---|
286 | <CODE>bp</CODE> (banner) program is specified, then it is used |
---|
287 | to generate a banner. |
---|
288 | If no program is available, we skip the banner generation. |
---|
289 | The banner generator program is started with the normal command line |
---|
290 | flags |
---|
291 | (see |
---|
292 | <A HREF="LPRng-HOWTO-13.html#filtercmd">Filter Command Line Flags</A>), |
---|
293 | with its STDOUT attached to the of_fd descriptor. |
---|
294 | The short banner string described in the previous step is written |
---|
295 | to the STDIN. |
---|
296 | The banner printer is responsible for generating a banner |
---|
297 | appropriate 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> Suppress FF Print File Separators</EM></LI> |
---|
310 | </UL> |
---|
311 | <P>Sequence of Operations: |
---|
312 | for each job in listed in the control file, |
---|
313 | the following operations are done in turn. |
---|
314 | <OL> |
---|
315 | <LI>If there is an <CODE>of</CODE> filter present, |
---|
316 | the suspend string <CODE>\031\001</CODE> is written to of_fd |
---|
317 | and the no further action is taken until the of filter is suspended.</LI> |
---|
318 | <LI>The control file line for the job is examined, |
---|
319 | and the first letter of the data file specification is used as the format.</LI> |
---|
320 | <LI>If the format is |
---|
321 | <CODE>p</CODE>, |
---|
322 | the job is first processed by the program specified by the |
---|
323 | <CODE>pr</CODE> |
---|
324 | program, |
---|
325 | and the program output used as the print file.</LI> |
---|
326 | <LI>If the format is |
---|
327 | <CODE>f</CODE>, |
---|
328 | <CODE>l</CODE>, |
---|
329 | or |
---|
330 | <CODE>p</CODE> |
---|
331 | then the <CODE>if</CODE> filter is used, |
---|
332 | otherwise the keyword |
---|
333 | <CODE>Xf</CODE> is used. |
---|
334 | Note 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>), |
---|
339 | and with its STDOUT attached to the printing device (io_fd), |
---|
340 | STDERR to the log file (<CODE>lf</CODE>), |
---|
341 | and file descriptor 3 to the accounting fd af_fd.</LI> |
---|
342 | <LI>When doing a read/write operation to a device or remote system, |
---|
343 | a timeout can be specified. |
---|
344 | When doing a print or job transfer operation, |
---|
345 | the <CODE>send_job_rw_timeout</CODE> value is used. |
---|
346 | When doing a status or query operation, |
---|
347 | the <CODE>send_query_rw_timeout</CODE> value is used. |
---|
348 | If a write or write operation does not complete within |
---|
349 | the specified timeout seconds, then we have an error |
---|
350 | condition and job processing or the query operation |
---|
351 | is terminated with JFAIL status. |
---|
352 | If 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. |
---|
356 | The exit status can be as follows: |
---|
357 | <BLOCKQUOTE><CODE> |
---|
358 | <PRE> |
---|
359 | Key Value Meaning |
---|
360 | JSUCC 0 Successful |
---|
361 | JFAIL 1, 32 Failed - retry later |
---|
362 | JABORT 2, 33 Abort - terminate queue processing |
---|
363 | JREMOVE 3, 34 Failed - remove job |
---|
364 | JHOLD 6, 37 Failed - hold this job |
---|
365 | Other 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, |
---|
370 | then 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, |
---|
374 | then 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, |
---|
376 | then the |
---|
377 | <CODE>ff</CODE> (form feed) string |
---|
378 | will 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> 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>, |
---|
389 | with the exception that the |
---|
390 | <CODE>be</CODE> (end banner program) is used to select the banner generation program |
---|
391 | rather than the |
---|
392 | <CODE>bs</CODE> (start banner program). |
---|
393 | <P>If we have <CODE>hl</CODE> true, |
---|
394 | then we print a banner at the end of the job, |
---|
395 | rather 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> Form Feed on Close</EM></LI> |
---|
403 | <LI> <CODE>la</CODE><EM> 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> 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, |
---|
412 | then the |
---|
413 | <CODE>ff</CODE> (form feed) string |
---|
414 | will be interpreted and sent to the of_fd.</LI> |
---|
415 | <LI>If we are printing, the <CODE>tr</CODE> (trailer) string |
---|
416 | will be interpreted and sent to the of_fd.</LI> |
---|
417 | <LI>If printing and the <CODE>la</CODE> (local printer accounting) flag is set |
---|
418 | or transferring a job and the <CODE>ar</CODE> (remote accounting) flag is set, |
---|
419 | the |
---|
420 | <CODE>ae</CODE> is examined and accounting is done as described |
---|
421 | for the |
---|
422 | <CODE> |
---|
423 | <A HREF="#accountstart">as</A> field.</CODE></LI> |
---|
424 | <LI>If the <CODE>of</CODE> filter is present, |
---|
425 | its STDIN is closed, |
---|
426 | and the <CODE>lpd</CODE> server waits for it to exit. |
---|
427 | The 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, |
---|
431 | the 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> Maximum Print or Transfer Attempts</EM></LI> |
---|
441 | <LI> <CODE>save_on_error</CODE><EM> 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> Stop processing queue on filter abort</EM></LI> |
---|
445 | </UL> |
---|
446 | <P>If the job processing terminates abnormally, |
---|
447 | the 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 |
---|
451 | by using a sequence of |
---|
452 | <CODE>kill -INT</CODE>, |
---|
453 | <CODE>kill -QUIT</CODE>, |
---|
454 | and finally |
---|
455 | <CODE>kill -KILL</CODE> operations.</LI> |
---|
456 | <LI>If there is a <CODE>mail_operator_on_error</CODE> value, |
---|
457 | the specified operator will be mailed an error indication. |
---|
458 | The <CODE>sendmail</CODE> option specifies the pathname of the |
---|
459 | <EM>sendmail</EM> program and the options needed to have it read |
---|
460 | mail addresses from its standard input. |
---|
461 | For example, <CODE>sendmail=/usr/sbin/sendmail -oi -t</CODE> |
---|
462 | is a commonly used set of options.</LI> |
---|
463 | <LI>The <CODE>mail_from</CODE> value specifies the user name used for |
---|
464 | mail origination. If not specified, the default is to use the print spool |
---|
465 | queue or printer name.</LI> |
---|
466 | <LI>If there is a <CODE>send_failure_action</CODE> specified, |
---|
467 | then it is decoded and the corresponding action taken. |
---|
468 | If the value is |
---|
469 | <CODE>remove</CODE>, |
---|
470 | <CODE>hold</CODE>, |
---|
471 | <CODE>abort</CODE>, |
---|
472 | or |
---|
473 | <CODE>retry</CODE>, |
---|
474 | then the job is removed, held, aborted, or retried. |
---|
475 | If the value is <CODE>|/program</CODE>, |
---|
476 | the program is executed and |
---|
477 | the number of attempts are written to the filter STDIN. |
---|
478 | The exit status of the filter will be used to determine the consequent actions. |
---|
479 | That is, JSUCC (0) will be success, and the standard success action will |
---|
480 | be taken; |
---|
481 | JFAIL will cause retry, |
---|
482 | JREMOVE will cause the job to be removed, |
---|
483 | JHOLD will cause the job to be held, |
---|
484 | JABORT or other status will abort processing.</LI> |
---|
485 | <LI>If the status is ABORT and the |
---|
486 | <CODE>stop_on_abort</CODE> |
---|
487 | flag is set, |
---|
488 | then further processing of jobs is terminated. |
---|
489 | The job is not removed from the queue.</LI> |
---|
490 | <LI>If the error status indicates removal, |
---|
491 | and the <CODE>save_on_error</CODE> flag is clear |
---|
492 | then the job is removed from the spool queue.</LI> |
---|
493 | <LI>If the error status indicates that no further operations should |
---|
494 | be performed on the queue, |
---|
495 | then the <CODE>lpd</CODE> server will stop processing jobs.</LI> |
---|
496 | <LI>If the error code indicated that the job should be retried, |
---|
497 | and the |
---|
498 | <CODE>send_try</CODE> value is 0 or the number of attempts is less than |
---|
499 | the <CODE>send_try</CODE> value, |
---|
500 | then the job is retried. |
---|
501 | Between each attempt to transfer a job to a remote site. |
---|
502 | This pause will double after each attempt, |
---|
503 | reaching a maximum of <CODE>max_connect_interval</CODE> seconds. |
---|
504 | If <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, |
---|
516 | it will fork a set of subserver processes, |
---|
517 | each which will handle an individual queue. |
---|
518 | <P>If a system has a large number of queues, |
---|
519 | then this forking operation may result in the <CODE>lpd</CODE> server |
---|
520 | exhausting the process resources. |
---|
521 | To control this, the |
---|
522 | <CODE>max_servers_active</CODE> value restricts the number of active |
---|
523 | children to the specified value. |
---|
524 | If this value is 0, |
---|
525 | then 50% of the maximum system processes value will be used. |
---|
526 | <P>Due to the limits on the number of processes, |
---|
527 | there may be times when a job is placed in a queue, |
---|
528 | but the <CODE>lpd</CODE> server is unable to start handling the job. |
---|
529 | When all of the children of the main <CODE>lpd</CODE> server have |
---|
530 | exited, |
---|
531 | the server starts a timer. |
---|
532 | After <CODE>lpd_poll_time</CODE> seconds, it will scan the queues, |
---|
533 | looking for jobs to process, |
---|
534 | and starts a process to service them. |
---|
535 | If it does not find any jobs it remains idle. |
---|
536 | <P>The <CODE>lpd_force_poll</CODE> flag causes the server to periodically |
---|
537 | poll the queues. |
---|
538 | This is useful when there is a high possibility that jobs could fail to be |
---|
539 | printed 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> |
---|