1.ds VE LPRng-3.9.0
2.TH LPQ 1 \*(VE "LPRng"
3.ig
4lpq.1,v 3.39 1998/03/29 18:37:49 papowell Exp
5Revised for LPRng
6Thu Jul 20 07:07:31 PDT 1995 Patrick Powell
7..
8.SH NAME
9lpq \- spool queue examination program
10.SH SYNOPSIS
11.B lpq
12[
13.B \-a
14] [
15.B \-A
16] [
17.B \-l
18] [
19.B \-L
20] [
21.BI \-P " printer"
22] [
23.B \-s
24]
25.ti +5n
26[
27.BI -t " sleeptime"
28]
29[
30.B \-V
31]
32[
33.BI \-D " debugopt"
34]
35.ti +5n
36[
37.IR jobid \|.\|.\|.
38]
39.SH DESCRIPTION
40.I lpq
41requests a status report from
42.IR lpd (8)
43on the specified printers or jobs.
44.I lpq
45invoked without any arguments
46reports on the printer given by the default printer
47(see
48.B \-P
49option).
50The short (default) format simply lists
51the printer, host, and numbers of jobs in the spool queue.
52When using the long format (-l option),
53for each job in a spool queue
54.I lpq
55reports the job identifier
56which is generated from the user's name and originating host,
57current rank in the queue,
58the job number (which may be supplied to
59.IR lprm (1)
60for removing a specific job),
61the job description information,
62and the total size in bytes.
63If there is an error or other problem with the job,
64this information may be modified to reflect the problems.
65In a spool queue,
66Job ordering is a modified FIFO (First in First Out),
67modified by the job class and priority information.
68.PP
69The following options are available.
70.IP "\fB-A\fR"
71Use authentication specified by the value of the AUTH environment variable.
72.IP "\fB-D\fR\fIdebugoptions\fR"
73Debugging is controlled using the
74.B \-D
75option. This accepts a comma-separated list of debugging
76settings. These settings take one of two forms: 
77.B facility=value , 
78or
79.B value 
80to set an overall default value.
81.IP "\fB\-P \fIprinter\fR"
82By default,
83the destination printer
84is taken from
85the command line
86.I printer
87value,
88then
89the environment variables
90PRINTER,
91LPDEST,
92NPRINTER,
93NGPRINTER,
94then first entry in the printcap information,
95and and finally the default_printer entry from the
96configuration file,
97and then the compile time default.
98.IP "\fB\-V\fR"
99Print version information.
100.IP "\fB\-a\fR"
101List status for all printers (see PRINTER LISTS below)
102which have entries for the LPRng client programs
103in the
104.IR printcap (5)
105database.
106.IP "\fB\-l\fR"
107Increase verbosity of the \fBl\fRong display format.
108A single -l options selects a short verbose display,
109multiple -l options increase the verbosity.
110.IP "\fB\-L\fR"
111Use maximum verbosity for the \fBl\fRong display format.
112.IP "\fB-s\fR"
113Display a short, single line status summary for each queue and subqueue.
114.IP "\fB-t\fR\fIsleeptime\fR"
115Forces
116.I lpq
117to periodically display the spool queues and then sleep
118.I sleeptime
119seconds between scans of the queue.
120.IP "jobid ... all"
121The options are followed by
122a list of jobids which
123are used to select jobs of interest.
124A jobid can be a user name,
125a job identifier,
126a job number,
127or a glob based pattern which will be applied to the
128job identifiers.
129The all keyword will display all jobs and is the default option.
130.PP
131The
132.I lpq
133will report the status of the spool queue (enabled for spooling,
134disabled for unspooling),
135and the absence of a server if unspooling is enabled.
136The
137.IR lpc (1)
138command
139.I "lpc start <printer>"
140may be used to start the server if this is the case.
141.SH ENVIRONMENT
142.PP
143By default,
144the destination printer
145is taken from
146the command line
147.I dest
148value,
149then
150the environment variables
151PRINTER,
152LPDEST,
153NPRINTER,
154NGPRINTER,
155then first entry in the printcap information,
156and and finally the default_printer entry from the
157configuration file,
158and then the compile time default.
159.SH "PRINTER LISTS"
160.PP
161The
162.B -a
163option is used to by
164.IR lpq (1)
165to get status for a list of printers.
166This list is formed as follows.
167.IP 1)
168The printcap file is scanned for printer entries.
169Only entries with names starting with a
170letter or digit are recognized as valid queue or printer names.
171.IP 2)
172If the special entry
173.I all
174is present,
175and it has a field
176.I ":all=pr1@host1,pr2@host2,..."
177then the printers
178.IR pr1 ,
179.IR pr2 ,
180\&...
181are used as the printer or queue list.
182.IP 3)
183If there is no all entry,
184then the original list of printers found in
185step 1)
186is used as the list of printers. 
187.PP
188The special case of
189.B "lpq -Pall"
190disables the searching of the printcap database,
191and simply sends a query to the lpd server for status
192of printer
193.BR all .
194The
195.IR lpd (8)
196server enumerates the printers in its printcap file,
197ignoring any
198.I all
199entry,
200and returns status only for printers which have entries in the
201.IR lpd (8)
202server printcap file.
203.PP
204Finally,
205the special case
206.B "lpq -Ppr@host"
207causes
208.IR lpq (1)
209to send a status request for printer
210.B pr
211to host
212.BR host .
213.PP
214Here is a simple set of rules to use:
215.nf
216.ft CW
217Client:
218 pr1:lp=%P@server
219 pr2:lp=%P@server
220  - printer pr1 followed by pr2
221
222pr1:lp=%P@server
223pr2:lp=%P@server
224all:all=pr2,pr1
225  - printer pr2 followed by pr1 (all overrides)
226
227Client:
228 pr1:lp=%P@server
229 pr2:lp=%P@server
230Server:
231 lp:lp=...
232  lpq -Pall
233    - status returned only for printer 'lp'
234.fi
235.SH "EXIT STATUS"
236.PP
237The following exit values are returned:
238.TP 15
239.B "zero (0)"
240Successful completion.
241.TP
242.B "non-zero (!=0)"
243An error occurred.
244.SH "PRINTCAP INFORMATION"
245.LP
246The printer names and other information is obtained by using a printcap
247file or some other database.
248The ${HOME}/.printcap
249file can be used to specify user level options and configuration
250information.
251See
252printcap(5)
253for more information. 
254.SH FILES
255.PP
256The files used by LPRng are set by values in the
257printer configuration file.
258The following are a commonly used set of default values.
259.nf
260.ta \w'/var/spool/lpd/printcap.<hostname>           'u
261_LPD_CONF_PATH_	LPRng configuration file
262${HOME}/.printcap	user printer description file
263_PRINTCAP_PATH_	printer description file
264_LPD_PERMS_PATH_	permissions
265_LOCKFILE_	lock file for queue control
266/var/spool/lpd		spool directories
267/var/spool/lpd/QUEUE/control	queue control
268/var/spool/lpd/QUEUE/log	trace or debug log file
269/var/spool/lpd/QUEUE/acct	accounting file
270/var/spool/lpd/QUEUE/status	status file
271.fi
272.SH "SEE ALSO"
273lpd.conf(5),
274lpc(8),
275lpd(8),
276checkpc(8),
277lpr(1),
278lprm(1),
279printcap(5),
280lpd.perms(5),
281pr(1), lprng_certs(1), lprng_index_certs(1).
282.SH DIAGNOSTICS
283.PP
284Most of the diagnostics are self explanatory.
285If you are puzzled over the exact cause of failure,
286set the debugging level on (-D5) and run again.
287The debugging information will 
288help you to pinpoint the exact cause of failure.
289.SH "HISTORY"
290.PP
291LPRng is a enhanced printer spooler system
292with functionality similar to the Berkeley LPR software.
293The LPRng mailing list is lprng@lprng.com;
294subscribe by sending mail to lprng-request@lprng.com with
295the word subscribe in the body.
296The software is available from ftp://ftp.lprng.com/pub/LPRng.
297.SH "AUTHOR"
298Patrick Powell <papowell@lprng.com>.
299