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