xref: /freebsd/usr.sbin/lpr/lpc/lpc.8 (revision 4a0f765fbf09711e612e86fce8bb09ec43f482d9)
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.\"
34.Dd April 28, 1995
35.Dt LPC 8
36.Os BSD 4.2
37.Sh NAME
38.Nm lpc
39.Nd line printer control program
40.Sh SYNOPSIS
41.Nm lpc
42.Oo
43.Ar command
44.Op Ar argument ...
45.Oc
46.Sh DESCRIPTION
47.Nm Lpc
48is used by the system administrator to control the
49operation of the line printer system.
50For each line printer configured in
51.Pa /etc/printcap ,
52.Nm lpc
53may be used to:
54.Bl -bullet -offset indent
55.It
56disable or enable a printer,
57.It
58disable or enable a printer's spooling queue,
59.It
60rearrange the order of jobs in a spooling queue,
61.It
62find the status of printers, and their associated
63spooling queues and printer daemons.
64.El
65.Pp
66Without any arguments,
67.Nm lpc
68will prompt for commands from the standard input.
69If arguments are supplied,
70.Nm lpc
71interprets the first argument as a command and the remaining
72arguments as parameters to the command.  The standard input
73may be redirected causing
74.Nm lpc
75to read commands from file.
76Commands may be abbreviated;
77the following is the list of recognized commands.
78.Pp
79.Bl -tag -width Ds -compact
80.It Ic \&? No [ command ... ]
81.It Ic help No [ command ... ]
82Print a short description of each command specified in the argument list,
83or, if no argument is given, a list of the recognized commands.
84.Pp
85.It Ic abort  No {\ all\ |\ printer\ }
86Terminate an active spooling daemon on the local host immediately and
87then disable printing (preventing new daemons from being started by
88.Xr lpr 1 )
89for the specified printers.
90.Pp
91.It Ic clean  No {\ all\ |\ printer\ }
92Remove any temporary files, data files, and control files that cannot
93be printed (i.e., do not form a complete printer job)
94from the specified printer queue(s) on the local machine.
95.Pp
96.It Ic disable  No {\ all\ |\ printer\ }
97Turn the specified printer queues off.  This prevents new
98printer jobs from being entered into the queue by
99.Xr lpr 1 .
100.Pp
101.It Ic down No {\ all\ |\ printer\ } message ...
102Turn the specified printer queue off, disable printing and put
103.Em message
104in the printer status file. The message doesn't need to be quoted, the
105remaining arguments are treated like
106.Xr echo 1 .
107This is normally used to take a printer down and let others know why
108.Xr lpq 1
109will indicate the printer is down and print the status message).
110.Pp
111.It Ic enable  No {\ all\ |\ printer\ }
112Enable spooling on the local queue for the listed printers.
113This will allow
114.Xr lpr 1
115to put new jobs in the spool queue.
116.Pp
117.It Ic exit
118.It Ic quit
119Exit from lpc.
120.\" ne 1i
121.Pp
122.It Ic restart  No {\ all\ |\ printer\ }
123Attempt to start a new printer daemon.
124This is useful when some abnormal condition causes the daemon to
125die unexpectedly, leaving jobs in the queue.
126.Xr Lpq 1
127will report that there is no daemon present when this condition occurs.
128If the user is the super-user,
129try to abort the current daemon first (i.e., kill and restart a stuck daemon).
130.Pp
131.It Ic start  No {\ all\ |\ printer\ }
132Enable printing and start a spooling daemon for the listed printers.
133.Pp
134.It Ic status  No {\ all\ |\ printer\ }
135Display the status of daemons and queues on the local machine.
136.Pp
137.It Ic stop  No {\ all\ |\ printer\ }
138Stop a spooling daemon after the current job completes and disable
139printing.
140.Pp
141.It Ic topq No printer\ [\ jobnum\ ...\ ]\ [\ user\ ...\ ]
142Place the jobs in the order listed at the top of the printer queue.
143.Pp
144.It Ic up  No {\ all\ |\ printer\ }
145Enable everything and start a new printer daemon. Undoes the effects of
146.Ic down .
147.Sh FILES
148.Bl -tag -width /var/spool/*/lockx -compact
149.It Pa /etc/printcap
150printer description file
151.It Pa /var/spool/*
152spool directories
153.It Pa /var/spool/*/lock
154lock file for queue control
155.El
156.Sh SEE ALSO
157.Xr lpq 1 ,
158.Xr lpr 1 ,
159.Xr lprm 1 ,
160.Xr printcap 5 ,
161.Xr lpd 8
162.Sh DIAGNOSTICS
163.Bl -tag -width Ds
164.It Sy "?Ambiguous command"
165abbreviation matches more than one command
166.It Sy "?Invalid command"
167no match was found
168.It Sy "?Privileged command"
169you must be a member of group "operator" or root to execute this command
170.El
171.Sh HISTORY
172The
173.Nm
174command appeared in
175.Bx 4.2 .
176