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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
|
.ds VE LPRng-3.9.0
.TH LPC 8 \*(VE "LPRng"
.ig
lpc.1,v 3.36 1998/03/29 18:37:49 papowell Exp
Mon Jul 17 20:14:17 PDT 1995 Patrick Powell
..
.SH NAME
lpc \- line printer control program
.SH SYNOPSIS
.B lpc
[
.BI \-A
]
[
.BI \-a
]
[
.BI \-D debugopts
]
[
.BI \-P printer
]
[
.BI \-S server
]
[
.BI \-U username
]
[
.B \-V
]
[ command [ argument ... ] ]
.SH DESCRIPTION
.I Lpc
is used by the system administrator to control the
operation of the line printer system.
For each line printer configured in
.I /etc/printcap
or the printcaps specified in the configuration file
.I /etc/lprng/lpd.conf
(see lpd.conf(5)),
.I lpc
may be used to:
.IP \(bu 3
disable or enable a single or all printer,
.IP \(bu 3
disable or enable a single printer's or all printer's spooling queue,
.IP \(bu 3
move jobs to the top a queue
.IP \(bu 3
find the status of printers, and their associated
spooling queues and printer daemons,
.IP \(bu 3
start and stop printer servers for a queue with multiple print servers,
.IP \(bu 3
hold and release a specific job in a printer queue,
.IP \(bu 3
redirect printing to another printer,
.IP \(bu 3
restart a printer job after having solved printer problems and let it
print from the beginning,
.IP \(bu 3
reprint a job
.PP
Without any arguments,
.I lpc
will prompt for commands from the standard input.
If arguments are supplied,
.IR lpc
interprets the first argument as a command and the remaining
arguments as parameters to the command.
Permission to use spool queue control commands is determined by the
printer permissions file
(See FILES).
.SH OPERATION
.PP
The operation of each spool queue is controlled by a
.I "spoolcontrol"
file which has a set of keyword options and values.
(Other print spoolers have used permissions bits of directories and files
for similar purposes).
In addition,
each job in the spool queue can have a
.I "holdfile"
which contains detailed information on how the spooler is to treat the
particular job.
The server will update these files with status and other information as the
job is processed.
The
.I lpc
command operates by sending requests to the
.I lpd
server process to update the information in these files and to signal
server processes that the information has been updated.
.SH OPTIONS
.IP "\fB\-A\fR" 5
Use authentication specified by the value of the AUTH environment variable.
.IP "\fB\-a\fR" 5
Alias for -Pall.
.IP "\fB\-P\fIprinter\fR" 5
Printer spool queue to operate on.
if no name is given,
the -P option,
the printer selected by the value of the PRINTER environment variable,
or the first entry in the printcap file will be used.
When all printers are selected,
the LPC command will first attempt to find the
printcap entry for printer ``all'';
the
.I all
printcap field value will be a list of printers to control.
If there is no printcap entry,
then the request is directly forwarded to the default LPD host,
which will do a lookup for all of the available printers.
By specifying ``all@host'',
the user can control all printers on a given host.
.IP "\fB\-S\fIserver\fR" 5
Send commands to this server,
rather than the one specified by the
\fB\-P\fIprinter\fR"
or printcap entry.
This allows you to use a default printcap entry for
authentication information or other setup information,
but direct queries to a specific server.
.IP "\fB\-V\fR" 5
Print program version information
.IP "\fB\-U\fIusername\fP\fR" 5
Set the user name for the request. This option is available only to
user root or to the userids listed in the
.I allow_user_setting
configuration option.
.IP "\fB\-D\fIdebugopts\fP" 5
Debugging is controlled using the
.B \-D
option. This accepts a comma-separated list of debugging
settings. These settings take one of two forms:
.B facility=value ,
or
.B value
to set an overall default value.
The form -D= will display a list of debugging options.
.SH COMMANDS
.PP
The following is the alphabetical list of recognized commands.
The jobcontrol or holdfile fields effective are listed as
part of the command.
.TP
?
.br
Help.
Also, any unrecognized input produces a help listing.
.TP
active [pr@[host]]
.br
makes a connection to the LPD server for the specified printer.
Closes the connection after making it.
This is useful for checking to see if a non-LPRng server is active.
.TP
abort { all | printer* }
.br
Kill the active job and disables unspooling.
The active job will not be deleted from the queue.
.br
Action: kills server process, updates spool control file
.I printing_disabled
field.
.TP
class {all | printer } (off | classlist | X=globmatch)
.br
Controls the class of jobs currently being printed.
The
.I off
option removes any class restrictions.
The classlist option is a list of classes;
for example A,B,C would release classes A, B, and C for printing.
The X=globmatch form performs a match against a control file entry
starting with the indicated capital letter.
For example, J=*form1* would allow jobs which had the string
form1 in their job title to be printed.
.TP
defaultq
.br
Lists the default queue for the LPC program.
.TP
defaults
.br
Lists default values for the configuration information.
.TP
debug j all | printer } [string | off ]
.br
Set the debugging string for the specified printer.
This is a diagnostic aid and should be used with caution;
refer to the reference manual for details of the debugging string format.
In general,
you can use:
.br
.I INTEGER
\- the integer number sets the general debugging level
.br
keyword=value
.br
\- sets a debugging variable to a specified value
.br
keyword
\- sets a debugging flag
.br
Action: updates spool control file
.I debug
field.
.TP
disable { all | printer }
.br
Disable spooling to the specified spool queues.
See
.I enable.
.br
Action: updates spool control file
.I printing_disabled
field.
.TP
down {all | printer }
.br
Disable both queuing and printing for all printers or the selected printer.
See
.I up.
.br
Action: updates spool control file
.I printing_disabled
and
.I spooling_disabled
fields.
.TP
enable { all | printer }
.br
Enable spooling for all printers or the selected printer.
.br
Action: updates spool control file
.I spooling_disabled
field.
.TP
exit or quit
.br
terminate LPC program
.TP
help
.br
Print a short help message.
.TP
hold printer { jobid }
.br
Holds the specified printer job (or jobs) in the queue.
The job will not be
printed even if spooling and printing is enabled. It must be released
with the release command.
The holdall command
or :ah: printcap flag can enable automatic holding of spooled jobs.
.br
Action: updates job holdfile
.I hold
field with time that job was held.
A 0 value release job for printing.
.TP
holdall { all | printer ... }
.br
Turn on automatic job holding of new jobs.
New jobs will be marked as held,
and held until released with the release command.
This will be done until holdall is turned off with the noholdall command.
The :ah: printcap flag can enable automatic holding as well.
.br
Action: updates spool control file
.I holdall
field.
.TP
kill { all | printer ... }
.br
Do an abort command followed by a start command.
This is a quick way to kill off a server that has problems.
Note that due to race conditions and delays,
that the start command may not be effective this action should
be monitored to ensure that the job restarts.
.TP
client { all | printer ... }
.br
Show the LPRng client configuration and printcap information on the local host.
This is an extremely useful diagnostic tool.
.TP
lpd [printer@[host]]
.br
determines if LPD daemon process on the print server is running,
and gets the PID.
This is handy to determine if the LPD daemon was killed or
aborted due to abnormal conditions.
.TP
lpq printer [options]
.br
Run
.I lpq
from inside the
.I lpc
program.
.TP
lprm printer jobid [jobid]*
.br
Run
.I lprm
from inside the
.I lpc
program.
Not all options are supported - this form requires
the printer name and jobid to be specified explicitly.
.TP
move printer jobid destinationPrinter
.br
Send the specified jobs to the destination printer and remove them
from the printer queue.
.br
Action: updates the job holdfile
.I move
field with the destination and starts a server process to do the
job transfer.
.TP
msg printer message text
.br
Update the status message for the printer.
An empty message will remove the status message.
.TP
noholdall { all | printer* }
.br
Turn off automatic job holding.
See holdall command.
.TP
quit or exit
.br
terminate LPC program
.TP
redirect [printer [destinationPrinter | off ]]
.br
redirect the jobs in the printer queue to another printer
or turn redirection off.
.br
Action: updates spool control file
.I redirect
field.
.TP
redo [printer [jobid]]
.br
Reprint the selected job.
.TP
release [printer [jobid]]
.br
Releases the selected job for printing.
.TP
reread [ printer [@host] ]
.br
Sends a request to the LPD server for the printer to reread the
configuration and printcap information.
This is equivalent to using
kill -HUP serverpid,
but can be done for servers on remote hosts.
.TP
server { all | printer }
.br
Shows the printcap entries for the printer or all printers as the LPD server
would use them.
.TP
start { all | printer }
.br
Start the printer.
This is useful when some abnormal condition causes the server to
terminate unexpectedly leaving jobs in the queue.
.I Lpq
will report that there is no daemon present when this condition occurs.
.TP
status { all | printer }
Display the status of daemons and queues on the local machine.
.TP
stop { all | printer }
.br
Disable any further unspooling after the current job completes.
.TP
topq printer [ jobid ]
.br
Place the selected jobs at the top of the printer queue.
.TP
up {all | printer ...}
Enables queuing and printing for the specified or all printers.
Privileged.
.SH JOBIDS
.PP
The LPQ command displays a job identifier for each job,
which can be used in LPC commands to identify a specific job.
In the commands descriptions above,
the jobid can be a user name,
a job number,
a job identifier,
or a glob pattern.
The glob pattern is matched against the job identifier.
In command which have an optional jobid,
if none is specified then the first printable job in the queue is acted on.
.SH FILES
.PP
The files used by LPRng are set by values in the
printer configuration file.
The following are a commonly used set of default values.
.nf
.ta \w'/var/spool/lpd/printcap.<hostname> 'u
/etc/lprng/lpd.conf LPRng configuration file
${HOME}/.printcap user printer description file
/etc/printcap printer description file
/etc/lprng/lpd.perms permissions
/var/run/lprng/lpd lock file for queue control
/var/spool/lpd spool directories
/var/spool/lpd/QUEUE/control queue control
/var/spool/lpd/QUEUE/log trace or debug log file
/var/spool/lpd/QUEUE/acct accounting file
/var/spool/lpd/QUEUE/status status file
.fi
.SH "SEE ALSO"
lpd.conf(5),
lpd(8),
checkpc(8),
lpr(1),
lpq(1),
lprm(1),
printcap(5),
lpd.perms(5),
pr(1), lprng_certs(1), lprng_index_certs(1).
.SH DIAGNOSTICS
.nf
Most of the diagnostics are self explanatory.
If you are puzzled over the exact cause of failure,
set the debugging level on (-D5) and run again.
The debugging information will
help you to pinpoint the exact cause of failure.
.fi
.SH "HISTORY"
LPRng is a enhanced printer spooler system
with functionality similar to the Berkeley LPR software.
The LPRng mailing list is lprng@lprng.com;
subscribe by sending mail to lprng-request@lprng.com with
the word subscribe in the body.
The software is available from ftp://ftp.lprng.com/pub/LPRng.
.SH "AUTHOR"
Patrick Powell <papowell@lprng.com>.
|