/usr/share/doc/lprng-doc/LPRng-Reference-Multipart/controllingprintqueue.htm is in lprng-doc 3.8.A~rc2-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.2.0">
<title>Controlling the Print Queue</title>
<meta name="GENERATOR" content=
"Modular DocBook HTML Stylesheet Version 1.79">
<link rel="HOME" title=" LPRng Reference Manual" href=
"index.htm">
<link rel="UP" title="Print Spooling Tutorial " href=
"tutorial.htm">
<link rel="PREVIOUS" title="Selecting the Print Queue" href=
"selectingprintqueue.htm">
<link rel="NEXT" title="Job Removal" href="jobremoval.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 Reference Manual: 24
Sep 2004 (For LPRng-3.8.28)</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href=
"selectingprintqueue.htm" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 4.
Print Spooling Tutorial</td>
<td width="10%" align="right" valign="bottom"><a href=
"jobremoval.htm" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="left" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="CONTROLLINGPRINTQUEUE" id=
"CONTROLLINGPRINTQUEUE">4.7. Controlling the Print
Queue</a></h1>
<p>The <b class="APPLICATION">lpc</b> command is used to
examine and control the print server operation. The <tt class=
"COMMAND">lpc status</tt> command displays the administrative
status of a print queue. The <b class="APPLICATION">lpd</b>
program caches status and job information in order to improve
performance. The <tt class="COMMAND">lpc flush</tt> command
will flush the cached information and cause the server to
regenerate it. The <tt class="COMMAND">lpc enable</tt> and
<tt class="COMMAND">lpc disable</tt> commands enable or disable
spooling to the print queue, and the <tt class="COMMAND">lpc
stop</tt> and <tt class="COMMAND">lpc start</tt> commands stop
and start printing (or transfers) of jobs in the print
queue.</p>
<p>Let's look at the status displayed when we use these
commands:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2001" id="AEN2001"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {120} % </samp><kbd class=
"USERINPUT">lpc status</kbd>
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 0 none none
<samp class="PROMPT">h4: {121} % </samp><kbd class=
"USERINPUT">lpc status all</kbd>
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 0 none none
lp2@h4 enabled enabled 0 none none
<samp class="PROMPT">h4: {122} % </samp><kbd class=
"USERINPUT">lpc</kbd>
lpc>status
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 0 none none
lpc>status all
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 0 none none
lp2@h4 enabled enabled 0 none none
lpc>quit</pre>
</div>
<p>The <b class="APPLICATION">lpc</b> command can be used in
command line or interactive mode as shown above. When used with
no parameters it will run in interactive mode, reading one or
more commands from its standard input (<acronym class=
"ACRONYM">STDIN</acronym>). The <tt class="COMMAND">lpc
status</tt> command shows the administrative status of the
select print queue. The <tt class="LITERAL">all</tt> queue name
selects all print queues for display. As shown in the above
example, both print queues have printing and spooling enabled
and there are no jobs in the print queue. The <span class=
"emphasis"><i class="EMPHASIS">Server</i></span> and
<span class="emphasis"><i class="EMPHASIS">Subserver</i></span>
information shows if there is a process which is printing jobs,
and its helper process that does the actual communication with
the printer.</p>
<p>It might be puzzling at first why <b class=
"APPLICATION">LPRng</b> uses two processes for this operation,
but the reason is very simple. Many operating system
implementations have <span class="emphasis"><i class=
"EMPHASIS">memory leaks</i></span> that cause the actual
process size to grow as it runs. This is especially true if a
large number of databases such as the password, Domain Name
Server, or other system database is consulted frequently with
different queries. Since this is usually done quite a lot by
the process which deals with the actual printing, the printing
process would soon grow very large and then die when it could
no longer obtain more memory. The <span class=
"emphasis"><i class="EMPHASIS">Server</i></span> process will
fork or create a child process <span class="emphasis"><i class=
"EMPHASIS">Subserver</i></span> process that is responsible for
the printing of a single job. When the job printing has been
completed, the <span class="emphasis"><i class=
"EMPHASIS">Subserver</i></span> process will exit and the
<span class="emphasis"><i class="EMPHASIS">Server</i></span>
process will then create another child until there are no more
jobs to be printed. The <span class="emphasis"><i class=
"EMPHASIS">Redirect</i></span> and <span class=
"emphasis"><i class="EMPHASIS">Debug</i></span> fields will be
discussed in later sections.</p>
<p>Now let's use the basic spool queue control commands:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2026" id="AEN2026"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {123} % </samp><kbd class=
"USERINPUT">lpc disable</kbd>
Printer: lp@h4
lp@h4.private: disabled
<samp class="PROMPT">h4: {124} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4 (spooling disabled)
Queue: no printable jobs in queue
<samp class="PROMPT">h4: {125} % </samp><kbd class=
"USERINPUT">lpc enable</kbd>
Printer: lp@h4
lp@h4.private: enabled
<samp class="PROMPT">h4: {126} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4
Queue: no printable jobs in queue
<samp class="PROMPT">h4: {127} % </samp><kbd class=
"USERINPUT">lpc stop</kbd>
Printer: lp@h4
lp@h4.private: stopped
<samp class="PROMPT">h4: {128} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4 (printing disabled)
Queue: no printable jobs in queue
<samp class="PROMPT">h4: {129} % </samp><kbd class=
"USERINPUT">lpc start</kbd>
Printer: lp@h4
lp@h4.private: started
<samp class="PROMPT">h4: {130} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4
Queue: no printable jobs in queue</pre>
</div>
<p>As we can see, the <b class="APPLICATION">lpc</b> command
also reports on the status of the print queue. Let's see what
happens when we print to a stopped queue:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2046" id="AEN2046"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {131} % </samp><kbd class=
"USERINPUT">lpc stop</kbd>
Printer: lp@h4
lp@h4.private: stopped
<samp class="PROMPT">h4: {132} % </samp><kbd class=
"USERINPUT">lpr /tmp/hi</kbd>
<samp class="PROMPT">h4: {133} % </samp><kbd class=
"USERINPUT">lpr /tmp/hi /tmp/there</kbd>
<samp class="PROMPT">h4: {134} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4 (printing disabled)
Queue: 2 printable jobs
Server: no server active
Rank Owner/ID Class Job Files Size Time
1 papowell@h4+17920 A 17920 /tmp/hi 3 18:14:22
2 papowell@h4+17922 A 17922 /tmp/hi,/tmp/there 9 18:14:30
<samp class="PROMPT">h4: {135} % </samp><kbd class=
"USERINPUT">lpc status</kbd>
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 disabled enabled 2 none none</pre>
</div>
<p>The <b class="APPLICATION">lpc</b> status shows that we have
two jobs spooled. The <span class="emphasis"><i class=
"EMPHASIS">Rank</i></span> field shows the order, the
<tt class="FILENAME">Owner/ID</tt> shows the unique job ID that
is assigned to the job and the <span class="emphasis"><i class=
"EMPHASIS">Class</i></span> field is the job class (this may be
changed with the <tt class="COMMAND">lpr -C class</tt> option).
The <span class="emphasis"><i class="EMPHASIS">Job</i></span>
field shows the <span class="emphasis"><i class="EMPHASIS">job
number</i></span> assigned to this job in this particular spool
queue. While the <acronym class="ACRONYM">ID</acronym> value
never changes as a job moves through the <b class=
"APPLICATION">LPRng</b> system, the <span class=
"emphasis"><i class="EMPHASIS">job number</i></span> is
specific to a particular spool queue and may change if a job is
<span class="emphasis"><i class="EMPHASIS">forwarded</i></span>
to another spool queue that has a job with the same job number.
The <span class="emphasis"><i class="EMPHASIS">Size</i></span>
field is the total number of printable bytes in the job, and
the <span class="emphasis"><i class="EMPHASIS">Time</i></span>
field shows the timestamp associated with the job.</p>
<p>Now let's start the print queue and watch what happens.</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2073" id="AEN2073"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {136} % </samp><kbd class=
"USERINPUT">lpc start</kbd>
Printer: lp@h4
lp@h4.private: started
<samp class="PROMPT">h4: {137} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4
Queue: 2 printable jobs
Server: pid 17928 active
Unspooler: pid 17929 active
Status: opening device '/tmp/lp' at 18:14:43.921
Rank Owner/ID Class Job Files Size Time
active papowell@h4+17920 A 17920 /tmp/hi 3 18:14:22
2 papowell@h4+17922 A 17922 /tmp/hi,/tmp/there 9 18:14:30
<samp class="PROMPT">h4: {138} % </samp><kbd class=
"USERINPUT">lpq -ll</kbd>
Printer: lp@h4
Queue: 2 printable jobs
Server: pid 17928 active
Unspooler: pid 17929 active
Status: printing job 'papowell@h4+17920' at 18:14:43.921
Status: no banner at 18:14:43.921
Status: printing data file 'dfA017920h4.private', size 57 at 18:14:43.922
Rank Owner/ID Class Job Files Size Time
active papowell@h4+17920 A 17920 /tmp/hi 3 18:14:22
2 papowell@h4+17922 A 17922 /tmp/hi,/tmp/there 9 18:14:30</pre>
</div>
<p>The <span class="emphasis"><i class=
"EMPHASIS">Rank</i></span> value of the first job has been
changed to <tt class="LITERAL">active</tt> and there is new
<span class="emphasis"><i class="EMPHASIS">Status</i></span>
information. If we use <tt class="COMMAND">lpq -ll</tt> we can
see the times that the various print operations are carried
out, and details of their success or failure.</p>
<p>We can also use the <b class="APPLICATION">lpc</b> command
to see the status of a particular job. We can select jobs by
the user name, the ID, or the job number. For example:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2088" id="AEN2088"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {139} % </samp><kbd class=
"USERINPUT">lpc stop</kbd>
Printer: lp@h4
lp@h4.private: stopped
<samp class="PROMPT">h4: {140} % </samp><kbd class=
"USERINPUT">echo hi |lpr</kbd>
<samp class="PROMPT">h4: {141} % </samp><kbd class=
"USERINPUT">echo there | lpr</kbd>
<samp class="PROMPT">h4: {142} % </samp><kbd class=
"USERINPUT">echo test |lpr</kbd>
<samp class="PROMPT">h4: {143} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4 (printing disabled)
Queue: 3 printable jobs
Server: no server active
Status: job 'papowell@h4+17922' removed at 18:15:13.981
Rank Owner/ID Class Job Files Size Time
1 papowell@h4+17959 A 17959 (stdin) 3 18:23:24
2 papowell@h4+17962 A 17962 (stdin) 6 18:23:30
3 papowell@h4+17970 A 17970 (stdin) 5 18:23:35
<samp class="PROMPT">h4: {144} % </samp><kbd class=
"USERINPUT">lpq 17970</kbd>
Printer: lp@h4 (printing disabled)
Queue: 3 printable jobs
Server: no server active
Status: job 'papowell@h4+17922' removed at 18:15:13.981
Rank Owner/ID Class Job Files Size Time
3 papowell@h4+17970 A 17970 (stdin) 5 18:23:35
<samp class="PROMPT">h4: {145} % </samp><kbd class=
"USERINPUT">lpq papowell</kbd>
Printer: lp@h4 (printing disabled)
Queue: 3 printable jobs
Server: no server active
Status: job 'papowell@h4+17922' removed at 18:15:13.981
Rank Owner/ID Class Job Files Size Time
1 papowell@h4+17959 A 17959 (stdin) 3 18:23:24
2 papowell@h4+17962 A 17962 (stdin) 6 18:23:30
3 papowell@h4+17970 A 17970 (stdin) 5 18:23:35
<samp class="PROMPT">h4: {146} % </samp><kbd class=
"USERINPUT">lpq -s 17970</kbd>
lp@h4 1 jobs
<samp class="PROMPT">h4: {147} % </samp><kbd class=
"USERINPUT">lpq -s papowell</kbd>
lp@h4 3 jobs
<samp class="PROMPT">h4: {148} % </samp><kbd class=
"USERINPUT">lpq -s nobody</kbd>
lp@h4 0 jobs</pre>
</div>
<p>We use <tt class="COMMAND">lpq -Pqueuename</tt> to select a
specific print queue and <tt class="COMMAND">lpq -a</tt> or
<tt class="COMMAND">lpq -Pall</tt> to select all queues:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2114" id="AEN2114"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {149} % </samp><kbd class=
"USERINPUT">lpc -a stop</kbd>
Printer: lp@h4
lp@h4.private: stopped
Printer: lp2@h4
lp2@h4.private: stopped
<samp class="PROMPT">h4: {150} % </samp><kbd class=
"USERINPUT">lpc -Pall start</kbd>
Printer: lp@h4
lp@h4.private: started
Printer: lp2@h4
lp2@h4.private: started</pre>
</div>
<p>You can use the <b class="APPLICATION">lpc</b> command in
<span class="emphasis"><i class=
"EMPHASIS">interactive</i></span> mode:</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2123" id="AEN2123"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {151} % </samp><kbd class="USERINPUT">lpc</kbd>
lpc>status
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 3 17990 17993
lpc>status all
Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug)
lp@h4 enabled enabled 3 17990 17993
lp2@h4 enabled enabled 3 none none
lpc>stop lp
Printer: lp@h4
lp@h4.private: stopped
lpc>start lp
Printer: lp@h4
lp@h4.private: started
lpc>quit</pre>
</div>
<p>The <tt class="COMMAND">lpc topq</tt> command can be used to
put a job (or jobs) at the head of the spool queue. This
command is very useful when some job requires priority service.
You can select the job by using the job number or the job
ID.</p>
<div class="INFORMALEXAMPLE">
<a name="AEN2129" id="AEN2129"></a>
<pre class="SCREEN"><samp class=
"PROMPT">h4: {152} % </samp><kbd class=
"USERINPUT">lpc topq lp 17970</kbd>
Printer: lp@h4
lp: selected 'papowell@h4+17970'
lp@h4.private: started
<samp class="PROMPT">h4: {153} % </samp><kbd class=
"USERINPUT">lpq</kbd>
Printer: lp@h4
Queue: 3 printable jobs
Server: pid 17999 active
Rank Owner/ID Class Job Files Size Time
active papowell@h4+17970 A 17970 (stdin) 5 18:23:35
1 papowell@h4+17959 A 17959 (stdin) 3 18:23:24
2 papowell@h4+17962 A 17962 (stdin) 6 18:23:30</pre>
</div>
</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=
"selectingprintqueue.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=
"jobremoval.htm" accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Selecting the
Print Queue</td>
<td width="34%" align="center" valign="top"><a href=
"tutorial.htm" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Job Removal</td>
</tr>
</table>
</div>
<p align="center"></p>
</body>
</html>
|