xref: /freebsd/usr.sbin/lpr/lpc/lpc.8 (revision ee41f1b1cf5e3d4f586cb85b46123b416275862c)
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 April 28, 1995
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.
99.Pp
100.It Ic disable Xo
101.Es \&{ \&}
102.En Cm all | Ar printer
103.Xc
104Turn the specified printer queues off.  This prevents new
105printer jobs from being entered into the queue by
106.Xr lpr 1 .
107.Pp
108.It Ic down Xo
109.Es \&{ \&}
110.En Cm all | Ar printer
111.Ar message ...
112.Xc
113Turn the specified printer queue off, disable printing and put
114.Ar message
115in the printer status file.
116The message doesn't need to be quoted, the
117remaining arguments are treated like
118.Xr echo 1 .
119This is normally used to take a printer down and let others know why
120.Xr lpq 1
121will indicate the printer is down and print the status message).
122.Pp
123.It Ic enable Xo
124.Es \&{ \&}
125.En Cm all | Ar printer
126.Xc
127Enable spooling on the local queue for the listed printers.
128This will allow
129.Xr lpr 1
130to put new jobs in the spool queue.
131.Pp
132.It Ic exit
133.It Ic quit
134Exit from
135.Nm .
136.Pp
137.It Ic restart Xo
138.Es \&{ \&}
139.En Cm all | Ar printer
140.Xc
141Attempt to start a new printer daemon.
142This is useful when some abnormal condition causes the daemon to
143die unexpectedly, leaving jobs in the queue.
144.Xr lpq 1
145will report that there is no daemon present when this condition occurs.
146If the user is the super-user,
147try to abort the current daemon first (i.e., kill and restart a stuck daemon).
148.Pp
149.It Ic start Xo
150.Es \&{ \&}
151.En Cm all | Ar printer
152.Xc
153Enable printing and start a spooling daemon for the listed printers.
154.Pp
155.It Ic status Xo
156.Es \&{ \&}
157.En Cm all | Ar printer
158.Xc
159Display the status of daemons and queues on the local machine.
160.Pp
161.It Ic stop Xo
162.Es \&{ \&}
163.En Cm all | Ar printer
164.Xc
165Stop a spooling daemon after the current job completes and disable
166printing.
167.Pp
168.It Ic topq Ar printer Xo
169.Op Ar jobnum ...
170.Op Ar user ...
171.Xc
172Place the jobs in the order listed at the top of the printer queue.
173.Pp
174.It Ic up Xo
175.Es \&{ \&}
176.En Cm all | Ar printer
177.Xc
178Enable everything and start a new printer daemon.
179Undoes the effects of
180.Ic down .
181.El
182.Sh FILES
183.Bl -tag -width /var/spool/*/lockx -compact
184.It Pa /etc/printcap
185printer description file
186.It Pa /var/spool/*
187spool directories
188.It Pa /var/spool/*/lock
189lock file for queue control
190.El
191.Sh SEE ALSO
192.Xr lpq 1 ,
193.Xr lpr 1 ,
194.Xr lprm 1 ,
195.Xr printcap 5 ,
196.Xr lpd 8
197.Sh DIAGNOSTICS
198.Bl -tag -width indent
199.It Sy "?Ambiguous command"
200abbreviation matches more than one command
201.It Sy "?Invalid command"
202no match was found
203.It Sy "?Privileged command"
204you must be a member of group "operator" or root to execute this command
205.El
206.Sh HISTORY
207The
208.Nm
209command appeared in
210.Bx 4.2 .
211