xref: /openbsd-src/usr.sbin/lpr/lpc/lpc.8 (revision 1d8c2aac128484a4b1a1c0b240fb26ace90c2a5a)
1.\"	$OpenBSD: lpc.8,v 1.14 2009/10/29 20:11:09 sobrado Exp $
2.\"	$NetBSD: lpc.8,v 1.14 2002/01/19 03:22:19 wiz Exp $
3.\"
4.\" Copyright (c) 1983, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)lpc.8	8.5 (Berkeley) 4/28/95
32.\"
33.Dd $Mdocdate: October 29 2009 $
34.Dt LPC 8
35.Os
36.Sh NAME
37.Nm lpc
38.Nd line printer control program
39.Sh SYNOPSIS
40.Nm lpc
41.Bk -words
42.Oo
43.Ar command
44.Op Ar argument ...
45.Oc
46.Ek
47.Sh DESCRIPTION
48.Nm
49is used by the system administrator to control the
50operation of the line printer system.
51For each line printer configured in
52.Pa /etc/printcap ,
53.Nm
54may be used to:
55.Bl -bullet -offset indent
56.It
57disable or enable a printer,
58.It
59disable or enable a printer's spooling queue,
60.It
61rearrange the order of jobs in a spooling queue,
62.It
63find the status of printers, and their associated
64spooling queues and printer daemons.
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 may be redirected causing
75.Nm
76to read commands from file.
77Commands may be abbreviated;
78the following is the list of recognized commands.
79.Pp
80.Bl -tag -width Ds -compact
81.It Ic \&? Op Ar command ...
82.It Ic help Op Ar command ...
83Print a short description of each command specified in the argument list,
84or, if no argument is given, a list of the recognized commands.
85.Pp
86.It Ic abort No {all | printer ...}
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 No {all | printer ...}
93Remove any temporary files, data files, and control files that cannot
94be printed (i.e., do not form a complete printer job)
95from the specified printer queue(s) on the local machine.
96.Pp
97.It Ic disable No {all | printer ...}
98Turn the specified printer queues off.
99This prevents new printer jobs from being entered into the queue by
100.Xr lpr 1 .
101.Pp
102.It Xo Ic down No {all | printer}
103.Op Ar message ...
104.Xc
105Turn the specified printer queue off, disable printing and put
106.Em message
107in the printer status file.
108The message doesn't need to be quoted, the
109remaining arguments are treated like
110.Xr echo 1 .
111This is normally used to take a printer down and let users know why.
112.Xr lpq 1
113will indicate the printer is down and print the status message.
114.Pp
115.It Ic enable No {all | printer ...}
116Enable spooling on the local queue for the listed printers.
117This will allow
118.Xr lpr 1
119to put new jobs in the spool queue.
120.Pp
121.It Ic exit
122.It Ic quit
123Exit from
124.Nm lpc .
125.Pp
126.It Ic restart No {all | printer ...}
127Attempt to start a new printer daemon.
128This is useful when some abnormal condition causes the daemon to
129die unexpectedly, leaving jobs in the queue.
130.Xr lpq 1
131will report that there is no daemon present when this condition occurs.
132If the user is the superuser,
133try to abort the current daemon first (i.e., kill and restart a stuck daemon).
134.Pp
135.It Ic start No {all | printer ...}
136Enable printing and start a spooling daemon for the listed printers.
137.Pp
138.It Ic status No {all | printer ...}
139Display the status of daemons and queues on the local machine.
140.Pp
141.It Ic stop No {all | printer ...}
142Stop a spooling daemon after the current job completes and disable
143printing.
144.Pp
145.It Xo Ic topq No printer
146.Op Ar jobnum ...
147.Op Ar user ...
148.Xc
149Place the jobs in the order listed at the top of the printer queue.
150.Pp
151.It Ic up No {all | printer ...}
152Enable everything and start a new printer daemon.
153Undoes the effects of
154.Ic down .
155.El
156.Sh FILES
157.Bl -tag -width /var/spool/output/*/lock -compact
158.It Pa /etc/printcap
159printer description file
160.It Pa /var/spool/output/*
161spool directories
162.It Pa /var/spool/output/*/lock
163lock file for queue control
164.El
165.Sh DIAGNOSTICS
166.Bl -tag -width Ds
167.It Sy "?Ambiguous command"
168Abbreviation matches more than one command.
169.It Sy "?Invalid command"
170No match was found.
171.It Sy "?Privileged command"
172You must be a member of group
173.Dq operator
174or user
175.Dq root
176to execute this command.
177.El
178.Sh SEE ALSO
179.Xr lpq 1 ,
180.Xr lpr 1 ,
181.Xr lprm 1 ,
182.Xr printcap 5 ,
183.Xr lpd 8
184.Sh HISTORY
185The
186.Nm
187command appeared in
188.Bx 4.2 .
189