version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
LPC |
|
|
2 |
!!!LPC |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPERATION |
|
|
7 |
OPTIONS |
|
|
8 |
COMMANDS |
|
|
9 |
JOBIDS |
|
|
10 |
FILES |
|
|
11 |
SEE ALSO |
|
|
12 |
DIAGNOSTICS |
|
|
13 |
HISTORY |
|
|
14 |
AUTHOR |
|
|
15 |
---- |
|
|
16 |
!!NAME |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
lpc - line printer control program |
|
|
20 |
!!SYNOPSIS |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
__lpc__ [[ __-A__ ] [[ __-a__ ] [[ |
|
|
24 |
__-D__''debugopts'' ] [[ __-P__''printer'' ] [[ |
|
|
25 |
__-S__''server'' ] [[ __-U__''username'' ] [[ |
|
|
26 |
__-V__ ] [[ command [[ argument ... ] ] |
|
|
27 |
!!DESCRIPTION |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
''Lpc'' is used by the system administrator to control |
|
|
31 |
the operation of the line printer system. For each line |
|
|
32 |
printer configured in ''/etc/lprng/printcap'' or the |
|
|
33 |
printcaps specified in the configuration file |
|
|
34 |
''/etc/lprng/lpd.conf'' (see lpd.conf(5)), ''lpc'' may |
|
|
35 |
be used to: |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
disable or enable a single or all printer, |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
disable or enable a single printer's or all printer's |
|
|
42 |
spooling queue, |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
move jobs to the top a queue |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
find the status of printers, and their associated spooling |
|
|
49 |
queues and printer dameons, |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
start and stop printer servers for a queue with multiple |
|
|
53 |
print servers, |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
hold and release a specific job in a printer |
|
|
57 |
queue, |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
redirect printing to another printer, |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
restart a printer job after having solved printer problems |
|
|
64 |
and let it print from the beginning, |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
reprint a job |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
Without any arguments, ''lpc'' will prompt for commands |
|
|
71 |
from the standard input. If arguments are supplied, |
|
|
72 |
''lpc'' interprets the first argument as a command and |
|
|
73 |
the remaining arguments as parameters to the command. |
|
|
74 |
Permission to use spool queue control commands is determined |
|
|
75 |
by the printer permissions file (See FILES). |
|
|
76 |
!!OPERATION |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
The operation of each spool queue is controlled by a |
|
|
80 |
''spoolcontrol'' file which has a set of keyword options |
|
|
81 |
and values. (Other print spoolers have used permissions bits |
|
|
82 |
of directories and files for similar purposes). In addition, |
|
|
83 |
each job in the spool queue can have a ''holdfile'' which |
|
|
84 |
contains detailed information on how the spooler is to treat |
|
|
85 |
the particular job. The server will update these files with |
|
|
86 |
status and other information as the job is processed. The |
|
|
87 |
''lpc'' command operates by sending requests to the |
|
|
88 |
''lpd'' server process to update the information in these |
|
|
89 |
files and to signal server processes that the information |
|
|
90 |
has been updated. |
|
|
91 |
!!OPTIONS |
|
|
92 |
|
|
|
93 |
|
|
|
94 |
__-A__ |
|
|
95 |
|
|
|
96 |
|
|
|
97 |
Use authentication specified by the value of the AUTH |
|
|
98 |
environment variable. |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
__-a__ |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
Alias for -Pall. |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
__-P__''printer'' |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
Printer spool queue to operate on. if no name is given, the |
|
|
111 |
-P option, the printer selected by the value of the PRINTER |
|
|
112 |
enviroment variable, or the first entry in the printcap file |
|
|
113 |
will be used. When all printers are selected, the LPC |
|
|
114 |
command will first attempt to find the printcap entry for |
|
|
115 |
printer ``all''; the ''all'' printcap field value will be |
|
|
116 |
a list of printers to control. If there is no printcap |
|
|
117 |
entry, then the request is directly forwarded to the default |
|
|
118 |
LPD host, which will do a lookup for all of the available |
|
|
119 |
printers. By specifying ``all@host'', the user can control |
|
|
120 |
all printers on a given host. |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
__-S__''server'' |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
Send commands to this server, rather than the one specified |
|
|
127 |
by the __-P__''printer'' |
|
|
128 |
'' |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
__-V__ |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
Print program version information |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
__-U__''username'' |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
Set the user name for the request. This option is available |
|
|
141 |
only to user root or to the userids listed in the |
|
|
142 |
''allow_user_setting'' configuration option. |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
__-D__''debugopts'' |
|
|
146 |
|
|
|
147 |
|
|
|
148 |
Debugging is controlled using the __-D__ option. This |
|
|
149 |
accepts a comma-separated list of debugging settings. These |
|
|
150 |
settings take one of two forms: __facility=value ,__ or |
|
|
151 |
__value__ to set an overall default value. The form -D= |
|
|
152 |
will display a list of debugging options. |
|
|
153 |
!!COMMANDS |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
The following is the alphabetical list of recognized |
|
|
157 |
commands. The jobcontrol or holdfile fields effective are |
|
|
158 |
listed as part of the command. |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
? |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
Help. Also, any unrecognized input produces a help |
|
|
165 |
listing. |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
active [[pr@[[host]] |
|
|
169 |
|
|
|
170 |
|
|
|
171 |
makes a connection to the LPD server for the specified |
|
|
172 |
printer. Closes the connection after making it. This is |
|
|
173 |
useful for checking to see if a non-LPRng server is |
|
|
174 |
active. |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
abort { all | printer* } |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
Kill the active job and disables unspooling. The active job |
|
|
181 |
will not be deleted from the queue. |
|
|
182 |
Action: kills server process, updates spool control file |
|
|
183 |
''printing_disabled'' field. |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
class {all | printer } (off | classlist | |
|
|
187 |
X=globmatch) |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
Controls the class of jobs currently being printed. The |
|
|
191 |
''off'' option removes any class restrictions. The |
|
|
192 |
classlist option is a list of classes; for example A,B,C |
|
|
193 |
would release classes A, B, and C for printing. The |
|
|
194 |
X=globmatch form performs a match against a control file |
|
|
195 |
entry starting with the indicated capital letter. For |
|
|
196 |
example, J=*form1* would allow jobs which had the string |
|
|
197 |
form1 in their job title to be printed. |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
defaultq |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
Lists the default queue for the LPC program. |
|
|
204 |
|
|
|
205 |
|
|
|
206 |
defaults |
|
|
207 |
|
|
|
208 |
|
|
|
209 |
Lists default values for the configuration |
|
|
210 |
information. |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
debug j all | printer } [[string | off ] |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
Set the debugging string for the specified printer. This is |
|
|
217 |
a diagnostic aid and should be used with caution; refer to |
|
|
218 |
the reference manual for details of the debugging string |
|
|
219 |
format. In general, you can use:'' |
|
|
220 |
INTEGER'' - the integer number sets the general debugging |
|
|
221 |
level |
|
|
222 |
keyword=value |
|
|
223 |
- sets a debugging variable to a specified value |
|
|
224 |
keyword - sets a debugging flag |
|
|
225 |
Action: updates spool control file ''debug'' |
|
|
226 |
field. |
|
|
227 |
|
|
|
228 |
|
|
|
229 |
disable { all | printer } |
|
|
230 |
|
|
|
231 |
|
|
|
232 |
Disable spooling to the specified spool queues. See |
|
|
233 |
''enable.'' |
|
|
234 |
Action: updates spool control file ''printing_disabled'' |
|
|
235 |
field. |
|
|
236 |
|
|
|
237 |
|
|
|
238 |
down {all | printer } |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
Disable both queuing and printing for all printers or the |
|
|
242 |
selected printer. See ''up.'' |
|
|
243 |
Action: updates spool control file ''printing_disabled'' |
|
|
244 |
and ''spooling_disabled'' fields. |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
enable { all | printer } |
|
|
248 |
|
|
|
249 |
|
|
|
250 |
Enable spooling for all printers or the selected |
|
|
251 |
printer. |
|
|
252 |
Action: updates spool control file ''spooling_disabled'' |
|
|
253 |
field. |
|
|
254 |
|
|
|
255 |
|
|
|
256 |
exit or quit |
|
|
257 |
|
|
|
258 |
|
|
|
259 |
terminate LPC program |
|
|
260 |
|
|
|
261 |
|
|
|
262 |
help |
|
|
263 |
|
|
|
264 |
|
|
|
265 |
Print a short help message. |
|
|
266 |
|
|
|
267 |
|
|
|
268 |
hold printer { jobid } |
|
|
269 |
|
|
|
270 |
|
|
|
271 |
Holds the specified printer job (or jobs) in the queue. The |
|
|
272 |
job will not be printed even if spooling and printing is |
|
|
273 |
enabled. It must be released with the relase command. The |
|
|
274 |
holdall command or :ah: printcap flag can enable automatic |
|
|
275 |
holding of spooled jobs. |
|
|
276 |
Action: updates job holdfile ''hold'' field with time |
|
|
277 |
that job was held. A 0 value release job for |
|
|
278 |
printing. |
|
|
279 |
|
|
|
280 |
|
|
|
281 |
holdall { all | printer ... } |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
Turn on automatic job holding of new jobs. New jobs will be |
|
|
285 |
marked as held, and held until released with the release |
|
|
286 |
command. This will be done until holdall is turned off with |
|
|
287 |
the noholdall command. The :ah: printcap flag can enable |
|
|
288 |
automatic holding as well. |
|
|
289 |
Action: updates spool control file ''holdall'' |
|
|
290 |
field. |
|
|
291 |
|
|
|
292 |
|
|
|
293 |
kill { all | printer ... } |
|
|
294 |
|
|
|
295 |
|
|
|
296 |
Do an abort command followed by a start command. This is a |
|
|
297 |
quick way to kill off a server that has problems. Note that |
|
|
298 |
due to race conditions and delays, that the start command |
|
|
299 |
may not be effective this action should be monitored to |
|
|
300 |
ensure that the job restarts. |
|
|
301 |
|
|
|
302 |
|
|
|
303 |
client { all | printer ... } |
|
|
304 |
|
|
|
305 |
|
|
|
306 |
Show the LPRng client configuration and printcap information |
|
|
307 |
on the local host. This is an extremely useful diagnostic |
|
|
308 |
tool. |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
lpd [[printer@[[host]] |
|
|
312 |
|
|
|
313 |
|
|
|
314 |
determines if LPD daemon process on the print server is |
|
|
315 |
running, and gets the PID. This is handy to determine if the |
|
|
316 |
LPD daemon was killed or aborted due to abnormal |
|
|
317 |
conditions. |
|
|
318 |
|
|
|
319 |
|
|
|
320 |
lpq printer [[options] |
|
|
321 |
|
|
|
322 |
|
|
|
323 |
Run ''lpq'' from inside the ''lpc'' |
|
|
324 |
program. |
|
|
325 |
|
|
|
326 |
|
|
|
327 |
lprm printer jobid [[jobid]* |
|
|
328 |
|
|
|
329 |
|
|
|
330 |
Run ''lprm'' from inside the ''lpc'' program. Not all |
|
|
331 |
options are supported - this form requires the printer name |
|
|
332 |
and jobid to be specified explicitly. |
|
|
333 |
|
|
|
334 |
|
|
|
335 |
move printer jobid destinationPrinter |
|
|
336 |
|
|
|
337 |
|
|
|
338 |
Send the specified jobs to the destination printer and |
|
|
339 |
remove them from the printer queue. |
|
|
340 |
Action: updates the job holdfile ''move'' field with the |
|
|
341 |
destination and starts a server process to do the job |
|
|
342 |
transfer. |
|
|
343 |
|
|
|
344 |
|
|
|
345 |
msg printer message text |
|
|
346 |
|
|
|
347 |
|
|
|
348 |
Update the status message for the printer. An empty message |
|
|
349 |
will remove the status message. |
|
|
350 |
|
|
|
351 |
|
|
|
352 |
noholdall { all | printer* } |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
Turn off automatic job holding. See holdall |
|
|
356 |
command. |
|
|
357 |
|
|
|
358 |
|
|
|
359 |
quit or exit |
|
|
360 |
|
|
|
361 |
|
|
|
362 |
terminate LPC program |
|
|
363 |
|
|
|
364 |
|
|
|
365 |
redirect [[printer [[destinationPrinter | off ]] |
|
|
366 |
|
|
|
367 |
|
|
|
368 |
redirect the jobs in the printer queue to another printer or |
|
|
369 |
turn redirection off. |
|
|
370 |
Action: updates spool control file ''redirect'' |
|
|
371 |
field. |
|
|
372 |
|
|
|
373 |
|
|
|
374 |
redo [[printer [[jobid]] |
|
|
375 |
|
|
|
376 |
|
|
|
377 |
Reprint the selected job. |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
release [[printer [[jobid]] |
|
|
381 |
|
|
|
382 |
|
|
|
383 |
Releases the selected job for printing. |
|
|
384 |
|
|
|
385 |
|
|
|
386 |
reread [[ printer [[@host] ] |
|
|
387 |
|
|
|
388 |
|
|
|
389 |
Sends a request to the LPD server for the printer to reread |
|
|
390 |
the configuration and printcap information. This is |
|
|
391 |
equivalent to using kill -HUP serverpid, but can be done for |
|
|
392 |
servers on remote hosts. |
|
|
393 |
|
|
|
394 |
|
|
|
395 |
server { all | printer } |
|
|
396 |
|
|
|
397 |
|
|
|
398 |
Shows the printcap entries for the printer or all printers |
|
|
399 |
as the LPD server would use them. |
|
|
400 |
|
|
|
401 |
|
|
|
402 |
start { all | printer } |
|
|
403 |
|
|
|
404 |
|
|
|
405 |
Start the printer. This is useful when some abnormal |
|
|
406 |
condition causes the server to terminate unexpectedly |
|
|
407 |
leaving jobs in the queue. ''Lpq'' will report that there |
|
|
408 |
is no daemon present when this condition |
|
|
409 |
occurs. |
|
|
410 |
|
|
|
411 |
|
|
|
412 |
status { all | printer } |
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Display the status of daemons and queues on the local |
|
|
416 |
machine. |
|
|
417 |
|
|
|
418 |
|
|
|
419 |
stop { all | printer } |
|
|
420 |
|
|
|
421 |
|
|
|
422 |
Disable any further unspooling after the current job |
|
|
423 |
completes. |
|
|
424 |
|
|
|
425 |
|
|
|
426 |
topq printer [[ jobid ] |
|
|
427 |
|
|
|
428 |
|
|
|
429 |
Place the selected jobs at the top of the printer |
|
|
430 |
queue. |
|
|
431 |
|
|
|
432 |
|
|
|
433 |
up {all | printer ...} |
|
|
434 |
|
|
|
435 |
|
|
|
436 |
Enables queuing and printing for the specified or all |
|
|
437 |
printers. Privileged. |
|
|
438 |
!!JOBIDS |
|
|
439 |
|
|
|
440 |
|
|
|
441 |
The LPQ command displays a job identifier for each job, |
|
|
442 |
which can be used in LPC commands to identify a specific |
|
|
443 |
job. In the commands descriptions above, the jobid can be a |
|
|
444 |
user name, a job number, a job identifier, or a glob |
|
|
445 |
pattern. The glob pattern is matched against the job |
|
|
446 |
identifier. In command which have an optional jobid, if none |
|
|
447 |
is specified then the first printable job in the queue is |
|
|
448 |
acted on. |
|
|
449 |
!!FILES |
|
|
450 |
|
|
|
451 |
|
|
|
452 |
The files used by LPRng are set by values in the printer |
|
|
453 |
configuration file. The following are a commonly used set of |
|
|
454 |
default values. |
|
|
455 |
|
|
|
456 |
|
|
|
457 |
/etc/lprng/lpd.conf LPRng configuration file |
|
|
458 |
${HOME}/.printcap user printer description file |
|
|
459 |
/etc/lprng/printcap printer description file |
|
|
460 |
/etc/lprng/lpd.perms permissions |
|
|
461 |
/var/run/lprng/lpd lock file for queue control |
|
|
462 |
/var/spool/lpd spool directories |
|
|
463 |
/var/spool/lpd/QUEUE/control queue control |
|
|
464 |
/var/spool/lpd/QUEUE/log trace or debug log file |
|
|
465 |
/var/spool/lpd/QUEUE/acct accounting file |
|
|
466 |
/var/spool/lpd/QUEUE/status status file |
|
|
467 |
!!SEE ALSO |
|
|
468 |
|
|
|
469 |
|
|
|
470 |
lpd.conf(5), lpd(8), checkpc(8), lpr(1), lpq(1), lprm(1), |
|
|
471 |
printcap(5), lpd.perms(5), pr(1). |
|
|
472 |
!!DIAGNOSTICS |
|
|
473 |
|
|
|
474 |
|
|
|
475 |
Most of the diagnostics are self explanatory. |
|
|
476 |
If you are puzzled over the exact cause of failure, |
|
|
477 |
set the debugging level on (-D5) and run again. |
|
|
478 |
The debugging information will |
|
|
479 |
help you to pinpoint the exact cause of failure. |
|
|
480 |
!!HISTORY |
|
|
481 |
|
|
|
482 |
|
|
|
483 |
LPRng is a enhanced printer spooler system with |
|
|
484 |
functionality similar to the Berkeley LPR software. The |
|
|
485 |
LPRng mailing list is lprng@lprng.com; subscribe by sending |
|
|
486 |
mail to lprng-request@lprng.com with the word subscribe in |
|
|
487 |
the body. The software is available from |
|
|
488 |
ftp://ftp.lprng.com/pub/LPRng. |
|
|
489 |
!!AUTHOR |
|
|
490 |
|
|
|
491 |
|
|
|
492 |
Patrick Powell |
|
|
493 |
---- |