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