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