File: Tutorial.04.nrf

package info (click to toggle)
lprng-doc 3.4.1-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,508 kB
  • ctags: 8
  • sloc: makefile: 139; perl: 62
file content (283 lines) | stat: -rw-r--r-- 7,767 bytes parent folder | download | duplicates (2)
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
.NH 1
LPC
.PP
The
.L lpc
program displays the current status of one or more spool queues.
.Rp
.Np
In one window,
start the LPD server using
.L "lpd -F"  .
.Np
The 
.L lpc
program can run in interactive or line mode.
We will first run it in interactive mode.
In another window,
run the
.L lpc
program.
You should see a status display similar to the following:
.DS
.L
.nf
lpc >
.DE
.PP
Try entering the help command:
.L "lpc > help" ;
this will display the help information.
.DS
.L
.nf
.in 0
.sz 9
usage: lpc [-Ddebuglevel] [-V] [-Pprinter] [commands]
 with no commands, reads from stdin  -Pprinter    - specify printer
  -V           - increase information verbosity
  -Ddebuglevel - debug level
 commands:
 abort   (printer[@host] | all)  - stop server
 autohold (printer[@host] | all)  - autohold on
 disable (printer[@host] | all)  - disable queueing
 debug   (printer[@host] | all) debugparms - set debug level for printer
 enable  (printer[@host] | all)  - enable  queueing
 hold    (printer[@host] | all) (name[@host] | job | all)* - hold job
 kill    (printer[@host] | all)  - stop and restart server
 lpd [HUP]  - get LPD PID, signal it to reread printcap and configuration
 lpq (printer[@host] | all) (name[@host] | job | all)*     - invoke LPQ
 lprm (printer[@host] | all) (name[@host]|host|job| all)*  - invoke LPRM
 noautohold (printer[@host] | all)  - autohold off
 printcap (printer[@host] | all) - report printcap values
 quit                            - exit LPC
 redirect (printer[@host] | all) (printer@host | off )*    - redirect jobs
 release  (printer[@host] | all) (name[@host] | job | all)* - release job
 reread                          - LPD reread database information
 start   (printer[@host] | all)  - start printing
 status  (printer[@host] | all)  - status of printers
 stop    (printer[@host] | all)  - stop  printing
 topq    (printer[@host] | all) (name[@host] | job | all)* - reorder job
.DE
.PP
The 
.L lpc
command can be used to start and stop printing,
spooling, and redirect jobs to other queues.
By default,
most commands work on the currently selected printer,
which is the users default printer or the last selected printer.
.NH 2
Status Reports
.PP
The
.L "status"
command can be used to show the status of printers.
.
.DS
.L
.nf
.sz 9
.in 0
lpc >status all
Printer              Printing Spooling Jobs  Server   Slave Redirect Debug
t1@taco               enabled  enabled    3    none    none          
t2@taco               enabled  enabled    0    none    none          
t3@taco               enabled  enabled    0    none    none          
t4@taco               enabled  enabled    0    none    none          
t5@taco               enabled  enabled    0    none    none          
t6@taco               enabled  enabled    0    none    none          
t3@taco               enabled  enabled    0    none    none          
.DE
.PP
The status display shows the name of the printer,
its print and spooling status,
the number of jobs in the queue,
if there is a server process active,
and if there is a slave process for the server process. 
The
redirect field indicates if the queue is being redirected to another print
queue and the debug field is the current debugging level set by the
lpc command.
.NH 2
Starting and Stopping Printing and Spooling
.PP
The
.I start
and
.I stop
commands can be used to start and stop printing.
.Rp
.Np
Enter the command
.L "stop t1" ,
.L "status" ,
.L "start" ,
and
.L "status"
as shown below.
.DS
.L
.nf
.in 0
.sz 9
lpc >stop t1
t1 stopped
lpc >status
Printer              Printing Spooling Jobs  Server   Slave Redirect Debug
t1@taco              disabled  enabled    3    none    none          
lpc >start
t1 started
lpc >status
Printer              Printing Spooling Jobs  Server   Slave Redirect Debug
t1@taco               enabled  enabled    3    none    none          
.DE
.PP
The
.L enable
and
.L disable
commands can be used to enable or disable spooling to the queue in a
similar manner.
.DS
.L
.nf
.in 0
.sz 9
lpc >disable t1
t1 disabled
lpc >status
Printer              Printing Spooling Jobs  Server   Slave Redirect Debug
t1@taco               enabled disabled    3    none    none          
lpc >enable t1
t1 enabled
lpc >status
Printer              Printing Spooling Jobs  Server   Slave Redirect Debug
t1@taco               enabled  enabled    3    none    none          
.DE
.NH 2
LPQ and LPRM Commands
.PP
For convenience,
the 
.L lprm
and
.L lpq
commands are available in interactive mode.
This allows jobs to be removed from a print queue and the
status of the print queue to be viewed after performing commands.
.NH 2
Killing and Aborting Print Queue
.PP
The abort and kill commands are used to kill of printing of a job.
The kill command will perform an abort operation followed by
a start operation.
.PP
The abort command is useful when a job is being printed and needs to be
restarted,
but at a later time using the start command.
The kill command is useful when a job can be immediately restarted.
.NH 2
TOPQ - Changing job priority
.PP
The topq command can be used to reorder the priority of user jobs.
Jobs that have their priority altered will be printed before
jobs that have not.
Updated jobs will be printed in last updated,
first out order.
.PP
For example,
the command
.L "topq root"
will have all of the root users jobs printed first,
starting with the oldest job in the queue.
.NH 2
Hold, Autohold, and Release
.PP
The hold,
autohold,
noautohold,
and release commands
are used to temporarily prevent a job from being printed.
The hold command is used to hold a job and the release command
to release it.
.PP
The
autohold option can be enabled in the
.L printcap
file using the
.L :ah:
printcap field.
If autohold is enabled,
then all jobs will be held until released using the
release command.
The interactive
autohold command can be used to override the printcap information.
The status of the autohold option is recorded in the
spool queue
.L control
file and will persist over system restarts.
Autohold can be turned off using the noautohold command.
.PP
When a job is released
the printer may need to be started if it is disabled.
.NH 2
Job and Queue Redirection
.PP
The move and redirect commands are used to move jobs
between different queues.
.PP
The
move command will move a selected set of jobs to a new queue.
For example,
.L "move t1 root t2"
will move all of the jobs on printer t1 submitted by root to the t2 printer.
.PP
The
redirect command will cause all jobs submitted to a particular spool
queue to be forwarded to the new printer.
The
.L "redirect off"
command will turn redirection off.
.NH 2
Diagnostic Commands - debug, lpd, reread, printcap
.PP
The debug,
lpd,
and lpq
commands are available for diagnostic purposes.
.PP
The debug command allows the adminstrator to set debugging
information and values for a specific spool queue.
For example,
.L "debug 7,remote=5,log=/tmp/x"
would set debugging to level 7,
the remote flag to 5,
and send debugging log information to the
.L /tmp/x
file.
The
.L "debug"
command with no options will turn all debugging options off.
.PP
The lpd command will print the process ID (PID) of the LPD server process.
The reread command will send it a
.L SIGHUP
signal,
causing it to reread the various databases.
.PP
The printcap command will cause the printcap entry for the specified
printer to be returned.
This is useful when trying to determine the actual values of a printcap
entry being used by the LPRng software.
.NH
Command Line Interface
.PP
The command line interface is identical to the interactive interface,
but only allows a single command to be entered at a time.
For example:
.L "lpc status all"
will print the status of all the printers,
and
.L "lpc start all"
will start all printers.