• 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>Job is not in print queue, but it gets printed!</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="The Most Frequently Asked Questions "
12    href="faq.htm">
13    <link rel="PREVIOUS" title=
14    "It was working normally, then I get connection refused errors"
15    href="x10703.htm">
16    <link rel="NEXT" title=
17    "Job disappears and is never printed, but lpr works" href=
18    "x10790.htm">
19  </head>
20
21  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
22  "#0000FF" vlink="#840084" alink="#0000FF">
23    <div class="NAVHEADER">
24      <table summary="Header navigation table" width="100%" border=
25      "0" cellpadding="0" cellspacing="0">
26        <tr>
27          <th colspan="3" align="center">LPRng Reference Manual: 5
28          Sep 2003 (For LPRng-3.8.22)</th>
29        </tr>
30
31        <tr>
32          <td width="10%" align="left" valign="bottom"><a href=
33          "x10703.htm" accesskey="P">Prev</a></td>
34
35          <td width="80%" align="center" valign="bottom">Chapter
36          20. The Most Frequently Asked Questions</td>
37
38          <td width="10%" align="right" valign="bottom"><a href=
39          "x10790.htm" accesskey="N">Next</a></td>
40        </tr>
41      </table>
42      <hr align="LEFT" width="100%">
43    </div>
44
45    <div class="SECT1">
46      <h1 class="SECT1"><a name="AEN10735">20.3. Job is not in
47      print queue, but it gets printed!</a></h1>
48
49      <p>In the original BSD <b class="APPLICATION">lpd</b>
50      implementation, the <b class="APPLICATION">lpr</b> program
51      copied users files to a special spool queue directory, and
52      then caused the <b class="APPLICATION">lpd</b> server to peek
53      in the directory and print the files.</p>
54
55      <p>This type of operation required spool directory space,
56      special SETUID programs, and a slew of headaches in system
57      security and management.</p>
58
59      <p>The LPR, <b class="APPLICATION">lpq</b>, and other user
60      programs in the <b class="APPLICATION">LPRng</b> suite use
61      TCP/IP connections and transfer jobs directly to a <b class=
62      "APPLICATION">lpd</b> server running on a remote host, or
63      even the local host if appropriate. Note that this type of
64      operation does not require a <b class="APPLICATION">lpd</b>
65      server to run on each local machine. In fact, you can have a
66      single host system performing all of your printing. This type
67      of operation is very similar to a central mail server versus
68      individual systems, each having their own mail server and
69      queues.</p>
70
71      <p>However, some users require or want their jobs to be
72      spooled on the local host system, and then transferred to the
73      remote printer. This is usually the case when some type of
74      processing (filtering) is needed in order to print the job
75      correctly. There are several methods that can be used to
76      force this.</p>
77
78      <p>Method 1: Explicit Printer Address</p>
79
80      <p>You can force a job to be sent directly to the <var class=
81      "LITERAL">pr</var> serviced by the <b class=
82      "APPLICATION">lpd</b> server on <var class=
83      "LITERAL">host</var> by using the form:</p>
84
85      <div class="INFORMALEXAMPLE">
86        <a name="AEN10753"></a>
87<pre class="SCREEN">
88    lpr -Ppr@host file
89</pre>
90      </div>
91      <br>
92      <br>
93
94      <p>You can also set the <acronym class=
95      "ACRONYM">PRINTER</acronym> environment variable to a similar
96      form, and get the same effect:</p>
97
98      <div class="INFORMALEXAMPLE">
99        <a name="AEN10757"></a>
100<pre class="SCREEN">
101    PRINTER=pr@host; export PRINTER;
102    lpr file
103</pre>
104      </div>
105      <br>
106      <br>
107
108      <p>Method 2: User and Server Printcap Entries</p>
109
110      <p>If you want to have the benefits of a printcap file, i.e.
111      - you can use aliases or abbreviations for the names of
112      printers, then here is a couple of hints. First, the <b
113      class="APPLICATION">LPRng</b> software scans the <tt class=
114      "FILENAME">printcap</tt> file for printcap entries, combining
115      information for the same printer into a single entry.
116      Information found later in the printcap file will override
117      earlier information. In addition, you can tag entries as
118      either being used for all utilities or just for the <b class=
119      "APPLICATION">lpd</b> server. Here are a couple of
120      examples:</p>
121
122      <div class="INFORMALEXAMPLE">
123        <a name="AEN10764"></a>
124<pre class="SCREEN">
125    # for all utilities
126    pr:lp=pr@host
127    # just for lpd
128    pr:server
129      :lp=/dev/lp
130    # more information
131    pr:check_for_nonprintable@
132    # --- final result for LPR
133    pr:lp=pr@host:check_for_nonprintable@
134    # --- final result for lpd
135    pr:lp=/dev/lp:check_for_nonprintable@
136</pre>
137      </div>
138      <br>
139      <br>
140
141      <p>As you can see, the <var class="LITERAL">server</var>
142      keyword indicates that the printcap entry is only for the
143      server. The <b class="APPLICATION">lpr</b> utility will send
144      the job to the host, while the <b class="APPLICATION">lpd</b>
145      server will print it on <tt class=
146      "FILENAME">/dev/lp</tt>.</p>
147
148      <p>Note that the <var class="LITERAL">lp=...</var>
149      information overrides the <var class="LITERAL">:rp:</var>
150      (remote printer) and <var class="LITERAL">:rm:</var> (remote
151      machine) fields if they are present.</p>
152
153      <p>Method 3: Force sending to server on <var class=
154      "LITERAL">localhost</var></p>
155
156      <p>The <var class="LITERAL">force_localhost</var> printcap or
157      configuration flag forces non-<b class="APPLICATION">lpd</b>
158      applications to send all requests and print jobs to the
159      server running on the local host.</p>
160
161      <p>This method is similar to the previous one, but has the
162      benefit that it can be configured as a global (i.e. - applies
163      to all printers) rather than printer specific. You can put
164      this in the <tt class="FILENAME">lpd.conf</tt> file for
165      general application, or have a printcap entry of the
166      following form:</p>
167
168      <div class="INFORMALEXAMPLE">
169        <a name="AEN10782"></a>
170<pre class="SCREEN">
171    # for all utilities
172    pr:lp=pr@host:force_localhost
173</pre>
174      </div>
175      <br>
176      <br>
177
178      <p>The <b class="APPLICATION">lpd</b> server will ignore the
179      <var class="LITERAL">force_localhost</var> flag, and send
180      jobs to the <var class="LITERAL">pr</var> queue on the <var
181      class="LITERAL">host</var> machine. However, the LPR, <b
182      class="APPLICATION">lpq</b>, etc., utilities will send their
183      requests to the server running on the local host.</p>
184    </div>
185
186    <div class="NAVFOOTER">
187      <hr align="LEFT" width="100%">
188
189      <table summary="Footer navigation table" width="100%" border=
190      "0" cellpadding="0" cellspacing="0">
191        <tr>
192          <td width="33%" align="left" valign="top"><a href=
193          "x10703.htm" accesskey="P">Prev</a></td>
194
195          <td width="34%" align="center" valign="top"><a href=
196          "index.htm" accesskey="H">Home</a></td>
197
198          <td width="33%" align="right" valign="top"><a href=
199          "x10790.htm" accesskey="N">Next</a></td>
200        </tr>
201
202        <tr>
203          <td width="33%" align="left" valign="top">It was working
204          normally, then I get connection refused errors</td>
205
206          <td width="34%" align="center" valign="top"><a href=
207          "faq.htm" accesskey="U">Up</a></td>
208
209          <td width="33%" align="right" valign="top">Job disappears
210          and is never printed, but lpr works</td>
211        </tr>
212      </table>
213    </div>
214  </body>
215</html>
216
217