File: x10515.htm

package info (click to toggle)
lprng 3.8.10-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 13,076 kB
  • ctags: 4,348
  • sloc: ansic: 35,394; sh: 10,756; perl: 2,210; makefile: 1,046
file content (214 lines) | stat: -rw-r--r-- 7,833 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta name="generator" content="HTML Tidy, see www.w3.org">
    <title>Job is not in print queue, but it gets printed!</title>
    <meta name="GENERATOR" content=
    "Modular DocBook HTML Stylesheet Version 1.71 ">
    <link rel="HOME" title=" LPRng-HOWTO" href="index.htm">
    <link rel="UP" title="The Most Frequently Asked Questions "
    href="faq.htm">
    <link rel="PREVIOUS" title=
    "It was working normally, then I get connection refused errors"
    href="x10483.htm">
    <link rel="NEXT" title=
    "Job disappears and is never printed, but lpr works" href=
    "x10570.htm">
  </head>

  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
  "#0000FF" vlink="#840084" alink="#0000FF">
    <div class="NAVHEADER">
      <table summary="Header navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <th colspan="3" align="center">LPRng-HOWTO: 1 Apr 2002
          (For LPRng-3.8.10)</th>
        </tr>

        <tr>
          <td width="10%" align="left" valign="bottom"><a href=
          "x10483.htm" accesskey="P">Prev</a></td>

          <td width="80%" align="center" valign="bottom">Chapter
          20. The Most Frequently Asked Questions</td>

          <td width="10%" align="right" valign="bottom"><a href=
          "x10570.htm" accesskey="N">Next</a></td>
        </tr>
      </table>
      <hr align="LEFT" width="100%">
    </div>

    <div class="SECT1">
      <h1 class="SECT1"><a name="AEN10515">20.3. Job is not in
      print queue, but it gets printed!</a></h1>

      <p>In the original BSD <b class="APPLICATION">lpd</b>
      implementation, the <b class="APPLICATION">lpr</b> program
      copied users files to a special spool queue directory, and
      then caused the <b class="APPLICATION">lpd</b> server to peek
      in the directory and print the files.</p>

      <p>This type of operation required spool directory space,
      special SETUID programs, and a slew of headaches in system
      security and management.</p>

      <p>The LPR, <b class="APPLICATION">lpq</b>, and other user
      programs in the <b class="APPLICATION">LPRng</b> suite use
      TCP/IP connections and transfer jobs directly to a <b class=
      "APPLICATION">lpd</b> server running on a remote host, or
      even the local host if appropriate. Note that this type of
      operation does not require a <b class="APPLICATION">lpd</b>
      server to run on each local machine. In fact, you can have a
      single host system performing all of your printing. This type
      of operation is very similar to a central mail server versus
      individual systems, each having their own mail server and
      queues.</p>

      <p>However, some users require or want their jobs to be
      spooled on the local host system, and then transferred to the
      remote printer. This is usually the case when some type of
      processing (filtering) is needed in order to print the job
      correctly. There are several methods that can be used to
      force this.</p>

      <p>Method 1: Explicit Printer Address</p>

      <p>You can force a job to be sent directly to the <tt class=
      "LITERAL">pr</tt> serviced by the <b class=
      "APPLICATION">lpd</b> server on <tt class="LITERAL">host</tt>
      by using the form:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN10533"></a>
<pre class="SCREEN">
    lpr -Ppr@host file
</pre>
      </div>
      <br>
      <br>

      <p>You can also set the <span class="ACRONYM">PRINTER</span>
      environment variable to a similar form, and get the same
      effect:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN10537"></a>
<pre class="SCREEN">
    PRINTER=pr@host; export PRINTER;
    lpr file
</pre>
      </div>
      <br>
      <br>

      <p>Method 2: User and Server Printcap Entries</p>

      <p>If you want to have the benefits of a printcap file, i.e.
      - you can use aliases or abbreviations for the names of
      printers, then here is a couple of hints. First, the <b
      class="APPLICATION">LPRng</b> software scans the <tt class=
      "FILENAME">printcap</tt> file for printcap entries, combining
      information for the same printer into a single entry.
      Information found later in the printcap file will override
      earlier information. In addition, you can tag entries as
      either being used for all utilities or just for the <b class=
      "APPLICATION">lpd</b> server. Here are a couple of
      examples:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN10544"></a>
<pre class="SCREEN">
    # for all utilities
    pr:lp=pr@host
    # just for lpd
    pr:server
      :lp=/dev/lp
    # more information
    pr:check_for_nonprintable@
    # --- final result for LPR
    pr:lp=pr@host:check_for_nonprintable@
    # --- final result for lpd
    pr:lp=/dev/lp:check_for_nonprintable@
</pre>
      </div>
      <br>
      <br>

      <p>As you can see, the <tt class="LITERAL">server</tt>
      keyword indicates that the printcap entry is only for the
      server. The <b class="APPLICATION">lpr</b> utility will send
      the job to the host, while the <b class="APPLICATION">lpd</b>
      server will print it on <tt class=
      "FILENAME">/dev/lp</tt>.</p>

      <p>Note that the <tt class="LITERAL">lp=...</tt> information
      overrides the <tt class="LITERAL">:rp:</tt> (remote printer)
      and <tt class="LITERAL">:rm:</tt> (remote machine) fields if
      they are present.</p>

      <p>Method 3: Force sending to server on <tt class=
      "LITERAL">localhost</tt></p>

      <p>The <tt class="LITERAL">force_localhost</tt> printcap or
      configuration flag forces non-<b class="APPLICATION">lpd</b>
      applications to send all requests and print jobs to the
      server running on the local host.</p>

      <p>This method is similar to the previous one, but has the
      benefit that it can be configured as a global (i.e. - applies
      to all printers) rather than printer specific. You can put
      this in the <tt class="FILENAME">lpd.conf</tt> file for
      general application, or have a printcap entry of the
      following form:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN10562"></a>
<pre class="SCREEN">
    # for all utilities
    pr:lp=pr@host:force_localhost
</pre>
      </div>
      <br>
      <br>

      <p>The <b class="APPLICATION">lpd</b> server will ignore the
      <tt class="LITERAL">force_localhost</tt> flag, and send jobs
      to the <tt class="LITERAL">pr</tt> queue on the <tt class=
      "LITERAL">host</tt> machine. However, the LPR, <b class=
      "APPLICATION">lpq</b>, etc., utilities will send their
      requests to the server running on the local host.</p>
    </div>

    <div class="NAVFOOTER">
      <hr align="LEFT" width="100%">

      <table summary="Footer navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="33%" align="left" valign="top"><a href=
          "x10483.htm" accesskey="P">Prev</a></td>

          <td width="34%" align="center" valign="top"><a href=
          "index.htm" accesskey="H">Home</a></td>

          <td width="33%" align="right" valign="top"><a href=
          "x10570.htm" accesskey="N">Next</a></td>
        </tr>

        <tr>
          <td width="33%" align="left" valign="top">It was working
          normally, then I get connection refused errors</td>

          <td width="34%" align="center" valign="top"><a href=
          "faq.htm" accesskey="U">Up</a></td>

          <td width="33%" align="right" valign="top">Job disappears
          and is never printed, but lpr works</td>
        </tr>
      </table>
    </div>
  </body>
</html>