xref: /dragonfly/usr.sbin/lpr/lpc/lpc.8 (revision dca3c15d)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)lpc.8	8.5 (Berkeley) 4/28/95
33.\" $FreeBSD: src/usr.sbin/lpr/lpc/lpc.8,v 1.8.2.13 2003/03/12 22:08:14 trhodes Exp $
34.\" $DragonFly: src/usr.sbin/lpr/lpc/lpc.8,v 1.3 2006/02/17 19:40:16 swildner Exp $
35.\"
36.Dd July 16, 2002
37.Dt LPC 8
38.Os
39.Sh NAME
40.Nm lpc
41.Nd line printer control program
42.Sh SYNOPSIS
43.Nm
44.Op Ar command Op Ar argument ...
45.Sh DESCRIPTION
46The
47.Nm
48utility is used by the system administrator to control the
49operation of the line printer system.
50For each line printer configured in
51.Pa /etc/printcap ,
52.Nm
53may be used to:
54.Bl -bullet -offset indent
55.It
56disable or enable a printer,
57.It
58disable or enable a printer's spooling queue,
59.It
60rearrange the order of jobs in a spooling queue,
61.It
62find the status of printers, and their associated
63spooling queues and printer daemons,
64.It
65change the status message for printer queues (the status message
66may be seen by users as part of the output of the
67.Xr lpq 1
68utility).
69.El
70.Pp
71Without any arguments,
72.Nm
73will prompt for commands from the standard input.
74If arguments are supplied,
75.Nm
76interprets the first argument as a command and the remaining
77arguments as parameters to the command.
78The standard input
79may be redirected causing
80.Nm
81to read commands from file.
82Commands may be abbreviated;
83the following is the list of recognized commands.
84.Pp
85.Bl -tag -width indent -compact
86.It Ic \&? Op Ar command ...
87.It Ic help Op Ar command ...
88Print a short description of each command specified in the argument list,
89or, if no argument is given, a list of the recognized commands.
90.Pp
91.It Ic abort Brq Cm all | Ar printer
92Terminate an active spooling daemon on the local host immediately and
93then disable printing (preventing new daemons from being started by
94.Xr lpr 1 )
95for the specified printers.
96.Pp
97.It Ic bottomq Ar printer Op Ar jobspec ...
98Take the specified jobs in the order specified and move them to the
99bottom of the printer queue.
100Each
101.Ar jobspec
102can match multiple print jobs.
103The full description of a
104.Ar jobspec
105is given below.
106.Pp
107.It Ic clean Brq Cm all | Ar printer
108Remove any temporary files, data files, and control files that cannot
109be printed (i.e., do not form a complete printer job)
110from the specified printer queue(s) on the local machine.
111This command will also look for
112.Pa core
113files in spool directory
114for each printer queue, and list any that are found.
115It will not remove any
116.Pa core
117files.
118See also the
119.Ic tclean
120command.
121.Pp
122.It Ic disable Brq Cm all | Ar printer
123Turn the specified printer queues off.
124This prevents new
125printer jobs from being entered into the queue by
126.Xr lpr 1 .
127.Pp
128.It Ic down Bro Cm all | Ar printer ... Brc Cm -msg Ar message ...
129.It Ic down Bro Cm all | Ar printer Brc Ar message ...
130Turn the specified printer queue off, disable printing and put
131.Ar message
132in the printer status file.
133When specifying more than one printer queue, the
134.Ic -msg
135argument is required to separate the list of printers from the text
136that will be the new status message.
137The message doesn't need to be quoted, the
138remaining arguments are treated like
139.Xr echo 1 .
140This is normally used to take a printer down, and let other users
141find out why it is down (the
142.Xr lpq 1
143utility will indicate that the printer is down and will print the
144status message).
145.Pp
146.It Ic enable Brq Cm all | Ar printer
147Enable spooling on the local queue for the listed printers.
148This will allow
149.Xr lpr 1
150to put new jobs in the spool queue.
151.Pp
152.It Ic exit
153.It Ic quit
154Exit from
155.Nm .
156.Pp
157.It Ic restart Brq Cm all | Ar printer
158Attempt to start a new printer daemon.
159This is useful when some abnormal condition causes the daemon to
160die unexpectedly, leaving jobs in the queue.
161.Xr lpq 1
162will report that there is no daemon present when this condition occurs.
163If the user is the super-user,
164try to abort the current daemon first (i.e., kill and restart a stuck daemon).
165.Pp
166.It Ic setstatus Bro Cm all | Ar printer Brc Cm -msg Ar message ...
167Set the status message for the specified printers.
168The
169.Ic -msg
170argument is required to separate the list of printers from the text
171that will be the new status message.
172This is normally used to change the status message when the printer
173queue is no longer active after printing has been disabled, and you
174want to change what users will see in the output of the
175.Xr lpq 1
176utility.
177.Pp
178.It Ic start Brq Cm all | Ar printer
179Enable printing and start a spooling daemon for the listed printers.
180.Pp
181.It Ic status Brq Cm all | Ar printer
182Display the status of daemons and queues on the local machine.
183.Pp
184.It Ic stop Brq Cm all | Ar printer
185Stop a spooling daemon after the current job completes and disable
186printing.
187.Pp
188.It Ic tclean Brq Cm all | Ar printer
189This will do a test-run of the
190.Ic clean
191command.
192All the same checking is done, but the command will only print out
193messages saying what a similar
194.Ic clean
195command would do if the user typed it in.
196It will not remove any files.
197Note that the
198.Ic clean
199command is a privileged command, while the
200.Ic tclean
201command is not restricted.
202.Pp
203.It Ic topq Ar printer Op Ar jobspec ...
204Take the specified jobs in the order specified and move them to the
205top of the printer queue.
206Each
207.Ar jobspec
208can match multiple print jobs.
209The full description of a
210.Ar jobspec
211is given below.
212.Pp
213.It Ic up Brq Cm all | Ar printer
214Enable everything and start a new printer daemon.
215Undoes the effects of
216.Ic down .
217.El
218.Pp
219Commands such as
220.Ic topq
221and
222.Ic bottomq
223can take one or more
224.Ar jobspec
225to specify which jobs the command should operate on.
226A
227.Ar jobspec
228can be:
229.Bl -bullet
230.It
231a single job number, which will match all jobs in the printer's queue
232which have the same job number.
233Eg:
234.Ar 17 ,
235.It
236a range of job numbers, which will match all jobs with a number between
237the starting and ending job numbers, inclusive.
238Eg:
239.Ar 21-32 ,
240.It
241a specific userid, which will match all jobs which were sent by that
242user.
243Eg:
244.Ar jones ,
245.It
246a host name, when prefixed by an `@', which will match all jobs in
247the queue which were sent from the given host.
248Eg:
249.Ar @freebsd.org ,
250.It
251a job range and a userid, separated by a `:', which will match all jobs
252which both match the job range and were sent by the specified user.
253Eg:
254.Ar jones:17
255or
256.Ar 21-32:jones ,
257.It
258a job range and/or a userid, followed by a host name, which will match
259all jobs which match all the specified criteria.
260Eg:
261.Ar jones@freebsd.org
262or
263.Ar 21-32@freebsd.org
264or
265.Ar jones:17@freebsd.org .
266.El
267.Pp
268The values for userid and host name can also include pattern-matching
269characters, similar to the pattern matching done for filenames in
270most command shells.
271Note that if you enter a
272.Ic topq
273or
274.Ic bottomq
275command as parameters on the initial
276.Nm
277command, then the shell will expand any pattern-matching characters
278that it can (based on what files in finds in the current directory)
279before
280.Nm
281processes the command.
282In that case, any parameters which include pattern-matching characters
283should be enclosed in quotes, so that the shell will not try to
284expand them.
285.Sh FILES
286.Bl -tag -width /var/spool/*/lockx -compact
287.It Pa /etc/printcap
288printer description file
289.It Pa /var/spool/*
290spool directories
291.It Pa /var/spool/*/lock
292lock file for queue control
293.El
294.Sh DIAGNOSTICS
295.Bl -diag
296.It "?Ambiguous command"
297abbreviation matches more than one command
298.It "?Invalid command"
299no match was found
300.It "?Privileged command"
301you must be a member of group "operator" or root to execute this command
302.El
303.Sh SEE ALSO
304.Xr lpq 1 ,
305.Xr lpr 1 ,
306.Xr lprm 1 ,
307.Xr printcap 5 ,
308.Xr chkprintcap 8 ,
309.Xr lpd 8
310.Sh HISTORY
311The
312.Nm
313utility appeared in
314.Bx 4.2 .
315