xref: /freebsd/usr.sbin/lpr/lpc/lpc.8 (revision 1b6c76a2fe091c74f08427e6c870851025a9cf67)
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$
34.\"
35.Dd June 20, 2001
36.Dt LPC 8
37.Os BSD 4.2
38.Sh NAME
39.Nm lpc
40.Nd line printer control program
41.Sh SYNOPSIS
42.Nm
43.Op Ar command Op Ar argument ...
44.Sh DESCRIPTION
45.Nm Lpc
46is used by the system administrator to control the
47operation of the line printer system.
48For each line printer configured in
49.Pa /etc/printcap ,
50.Nm
51may be used to:
52.Bl -bullet -offset indent
53.It
54disable or enable a printer,
55.It
56disable or enable a printer's spooling queue,
57.It
58rearrange the order of jobs in a spooling queue,
59.It
60find the status of printers, and their associated
61spooling queues and printer daemons.
62.El
63.Pp
64Without any arguments,
65.Nm
66will prompt for commands from the standard input.
67If arguments are supplied,
68.Nm
69interprets the first argument as a command and the remaining
70arguments as parameters to the command.  The standard input
71may be redirected causing
72.Nm
73to read commands from file.
74Commands may be abbreviated;
75the following is the list of recognized commands.
76.Pp
77.Bl -tag -width indent -compact
78.It Ic \&? Op Ar command ...
79.It Ic help Op Ar command ...
80Print a short description of each command specified in the argument list,
81or, if no argument is given, a list of the recognized commands.
82.Pp
83.It Ic abort Xo
84.Es \&{ \&}
85.En Cm all | Ar printer
86.Xc
87Terminate an active spooling daemon on the local host immediately and
88then disable printing (preventing new daemons from being started by
89.Xr lpr 1 )
90for the specified printers.
91.Pp
92.It Ic clean Xo
93.Es \&{ \&}
94.En Cm all | Ar printer
95.Xc
96Remove any temporary files, data files, and control files that cannot
97be printed (i.e., do not form a complete printer job)
98from the specified printer queue(s) on the local machine.
99This command will also look for 'core' files in spool directory
100for each printer queue, and list any that are found.
101It will not remove any 'core' files.  See also the
102.Ic tclean
103command.
104.Pp
105.It Ic disable Xo
106.Es \&{ \&}
107.En Cm all | Ar printer
108.Xc
109Turn the specified printer queues off.  This prevents new
110printer jobs from being entered into the queue by
111.Xr lpr 1 .
112.Pp
113.It Ic down Xo
114.Es \&{ \&}
115.En Cm all | Ar printer
116.Ar message ...
117.Xc
118Turn the specified printer queue off, disable printing and put
119.Ar message
120in the printer status file.
121The message doesn't need to be quoted, the
122remaining arguments are treated like
123.Xr echo 1 .
124This is normally used to take a printer down and let others know why
125.Xr lpq 1
126will indicate the printer is down and print the status message).
127.Pp
128.It Ic enable Xo
129.Es \&{ \&}
130.En Cm all | Ar printer
131.Xc
132Enable spooling on the local queue for the listed printers.
133This will allow
134.Xr lpr 1
135to put new jobs in the spool queue.
136.Pp
137.It Ic exit
138.It Ic quit
139Exit from
140.Nm .
141.Pp
142.It Ic restart Xo
143.Es \&{ \&}
144.En Cm all | Ar printer
145.Xc
146Attempt to start a new printer daemon.
147This is useful when some abnormal condition causes the daemon to
148die unexpectedly, leaving jobs in the queue.
149.Xr lpq 1
150will report that there is no daemon present when this condition occurs.
151If the user is the super-user,
152try to abort the current daemon first (i.e., kill and restart a stuck daemon).
153.Pp
154.It Ic start Xo
155.Es \&{ \&}
156.En Cm all | Ar printer
157.Xc
158Enable printing and start a spooling daemon for the listed printers.
159.Pp
160.It Ic status Xo
161.Es \&{ \&}
162.En Cm all | Ar printer
163.Xc
164Display the status of daemons and queues on the local machine.
165.Pp
166.It Ic stop Xo
167.Es \&{ \&}
168.En Cm all | Ar printer
169.Xc
170Stop a spooling daemon after the current job completes and disable
171printing.
172.Pp
173.It Ic tclean Xo
174.Es \&{ \&}
175.En Cm all | Ar printer
176.Xc
177This will do a test-run of the
178.Ic clean
179command.
180All the same checking is done, but the command will only print out
181messages saying what a similar
182.Ic clean
183command would do if the user typed it in.
184It will not remove any files.
185Note that the
186.Ic clean
187command is a privileged command, while the
188.Ic tclean
189command is not restricted.
190.Pp
191.It Ic topq Ar printer Xo
192.Op Ar jobnum ...
193.Op Ar user ...
194.Xc
195Place the jobs in the order listed at the top of the printer queue.
196.Pp
197.It Ic up Xo
198.Es \&{ \&}
199.En Cm all | Ar printer
200.Xc
201Enable everything and start a new printer daemon.
202Undoes the effects of
203.Ic down .
204.El
205.Sh FILES
206.Bl -tag -width /var/spool/*/lockx -compact
207.It Pa /etc/printcap
208printer description file
209.It Pa /var/spool/*
210spool directories
211.It Pa /var/spool/*/lock
212lock file for queue control
213.El
214.Sh SEE ALSO
215.Xr lpq 1 ,
216.Xr lpr 1 ,
217.Xr lprm 1 ,
218.Xr printcap 5 ,
219.Xr lpd 8
220.Sh DIAGNOSTICS
221.Bl -diag
222.It "?Ambiguous command"
223abbreviation matches more than one command
224.It "?Invalid command"
225no match was found
226.It "?Privileged command"
227you must be a member of group "operator" or root to execute this command
228.El
229.Sh HISTORY
230The
231.Nm
232command appeared in
233.Bx 4.2 .
234