• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/LPRng/DOCS/LPRng-Reference-Multipart/
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<html>
4  <head>
5    <meta name="generator" content="HTML Tidy, see www.w3.org">
6    <title>Submitting Jobs and Service Requests</title>
7    <meta name="GENERATOR" content=
8    "Modular DocBook HTML Stylesheet Version 1.7">
9    <link rel="HOME" title=" LPRng Reference Manual" href=
10    "index.htm">
11    <link rel="UP" title="Job Processing" href="jobsteps.htm">
12    <link rel="PREVIOUS" title="Job Processing" href=
13    "jobsteps.htm">
14    <link rel="NEXT" title="Job Reception " href="reception.htm">
15  </head>
16
17  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
18  "#0000FF" vlink="#840084" alink="#0000FF">
19    <div class="NAVHEADER">
20      <table summary="Header navigation table" width="100%" border=
21      "0" cellpadding="0" cellspacing="0">
22        <tr>
23          <th colspan="3" align="center">LPRng Reference Manual: 5
24          Sep 2003 (For LPRng-3.8.22)</th>
25        </tr>
26
27        <tr>
28          <td width="10%" align="left" valign="bottom"><a href=
29          "jobsteps.htm" accesskey="P">Prev</a></td>
30
31          <td width="80%" align="center" valign="bottom">Chapter
32          15. Job Processing</td>
33
34          <td width="10%" align="right" valign="bottom"><a href=
35          "reception.htm" accesskey="N">Next</a></td>
36        </tr>
37      </table>
38      <hr align="LEFT" width="100%">
39    </div>
40
41    <div class="SECT1">
42      <h1 class="SECT1"><a name="SUBMITTING">15.2. Submitting Jobs
43      and Service Requests</a></h1>
44
45      <p>Options used:</p>
46
47      <ul>
48        <li>
49          <p><var class="LITERAL">lpd_port=</var><span class=
50          "emphasis"><i class="EMPHASIS">Listening Port for <b
51          class="APPLICATION">lpd</b></i></span></p>
52        </li>
53
54        <li>
55          <p><var class="LITERAL">unix_socket_path=</var><span
56          class="emphasis"><i class="EMPHASIS">Unix socket for <b
57          class="APPLICATION">lpd</b> connections</i></span></p>
58        </li>
59      </ul>
60      <br>
61      <br>
62
63      <p>After the <b class="APPLICATION">lpd</b> server has done
64      its initialization, it will attempt to bind to the <b class=
65      "APPLICATION">lpd</b> listening port specified by the <var
66      class="LITERAL">lpd_port</var> value. This value has the
67      format <var class="LITERAL">[ipaddr%]port</var>. If the <var
68      class="LITERAL">ipaddr</var> is specified then the lpd server
69      binds to the interface with the specified address otherwise
70      it binds to all interfaces. The port value can be a number or
71      name the name of a service; The port corresponding to the
72      service name is used. The <var class="LITERAL">printer</var>
73      services port is 515. If the port binding operation is
74      successful and the server has not been request to run in
75      <span class="emphasis"><i class=
76      "EMPHASIS">foreground</i></span> mode by the <var class=
77      "LITERAL">-F</var> command line option, then a child process
78      is forked and the parent process will exit. The child process
79      then takes steps to disconnect itself from the control
80      terminal of the process that started it.</p>
81
82      <p>The <var class="LITERAL">unix_socket_path</var> option
83      specifies the pathname of a <span class="emphasis"><i class=
84      "EMPHASIS">fifo</i></span> socket that local processes can
85      use instead of the TCP/IP port.</p>
86
87      <p>The main <b class="APPLICATION">lpd</b> process will then
88      start a <span class="emphasis"><i class="EMPHASIS">queue
89      checking</i></span> process that will check all of the spool
90      queues used by the server for queues that have pending jobs.
91      This process sends a message to the main <b class=
92      "APPLICATION">lpd</b> process requesting that it start a
93      service process for this queue.</p>
94
95      <p>The <b class="APPLICATION">lpd</b> process will then sit
96      in a loop waiting for one of the following events:</p>
97
98      <ol type="1">
99        <li>
100          <p>An incoming connection request. If the maximum number
101          of children has not been exceeded, then a new process
102          will be forked to handle this connection.</p>
103        </li>
104
105        <li>
106          <p>A child process exiting. The server will check to see
107          if there is a pending request to start a server for a
108          queue that could not be accommodated due to too many
109          processes running.</p>
110        </li>
111
112        <li>
113          <p>A request to start a service process for a queue. If
114          the number of active processes is less than the maximum
115          allowed a service process will be started, otherwise the
116          request will be placed on a list for service when the
117          number of processes active decreases.</p>
118        </li>
119
120        <li>
121          <p>A timeout alarm for the queue rescanning operation.
122          This is discussed in the next section in detail.</p>
123        </li>
124      </ol>
125
126      <p>When connection is accepted by the <b class=
127      "APPLICATION">lpd</b> spooler, the following steps are taken
128      to processes the job.</p>
129
130      <ol type="1">
131        <li>
132          <p>First, a timeout is established for the transfer of
133          the information from client to the <b class=
134          "APPLICATION">lpd</b> server. This is done to prevent a
135          denial of service attack by processes that do not close
136          connections in a timely manner.</p>
137        </li>
138
139        <li>
140          <p>A single line is read into an internal buffer. This
141          line must be terminated with a <var class=
142          "LITERAL">NEWLINE</var> character.</p>
143        </li>
144
145        <li>
146          <p>The input line is parsed and the actions required are
147          determined.</p>
148        </li>
149
150        <li>
151          <p>If the activity requires access to the spool queue
152          information, then the current directory of the process is
153          changed to the spool directory. This allows all file
154          accesses to then be relative to this directory.</p>
155        </li>
156
157        <li>
158          <p>If the processing requires starting a spool queue
159          server process, a message is sent to the main <b class=
160          "APPLICATION">lpd</b> server process to start a spool
161          queue server process. By having all the processes serving
162          spool queues children of the main server process it is
163          possible to monitor and limit the total number of active
164          processes. This is important on systems with a very large
165          number of queues.</p>
166        </li>
167
168        <li>
169          <p>After the processing of the original request has been
170          completed, the process with then check to see if the
171          Spool Queue for the printer should be processed.</p>
172        </li>
173      </ol>
174    </div>
175
176    <div class="NAVFOOTER">
177      <hr align="LEFT" width="100%">
178
179      <table summary="Footer navigation table" width="100%" border=
180      "0" cellpadding="0" cellspacing="0">
181        <tr>
182          <td width="33%" align="left" valign="top"><a href=
183          "jobsteps.htm" accesskey="P">Prev</a></td>
184
185          <td width="34%" align="center" valign="top"><a href=
186          "index.htm" accesskey="H">Home</a></td>
187
188          <td width="33%" align="right" valign="top"><a href=
189          "reception.htm" accesskey="N">Next</a></td>
190        </tr>
191
192        <tr>
193          <td width="33%" align="left" valign="top">Job
194          Processing</td>
195
196          <td width="34%" align="center" valign="top"><a href=
197          "jobsteps.htm" accesskey="U">Up</a></td>
198
199          <td width="33%" align="right" valign="top">Job
200          Reception</td>
201        </tr>
202      </table>
203    </div>
204  </body>
205</html>
206
207