xref: /netbsd-src/usr.sbin/lpr/lpc/lpc.8 (revision aaf4ece63a859a04e37cf3a7229b5fab0157cc06)
1.\"	$NetBSD: lpc.8,v 1.16 2003/08/07 11:25:27 agc 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. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)lpc.8	8.5 (Berkeley) 4/28/95
31.\"
32.Dd April 28, 1995
33.Dt LPC 8
34.Os
35.Sh NAME
36.Nm lpc
37.Nd line printer control program
38.Sh SYNOPSIS
39.Nm
40.Bk -words
41.Oo
42.Ar command
43.Op Ar argument ...
44.Oc
45.Ek
46.Sh DESCRIPTION
47.Nm
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
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
68will prompt for commands from the standard input.
69If arguments are supplied,
70.Nm
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
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.Pp
121.It Ic restart  No {\ all\ |\ printer\ }
122Attempt to start a new printer daemon.
123This is useful when some abnormal condition causes the daemon to
124die unexpectedly, leaving jobs in the queue.
125.Xr lpq 1
126will report that there is no daemon present when this condition occurs.
127If the user is the super-user,
128try to abort the current daemon first (i.e., kill and restart a stuck daemon).
129.Pp
130.It Ic start  No {\ all\ |\ printer\ }
131Enable printing and start a spooling daemon for the listed printers.
132.Pp
133.It Ic status  No {\ all\ |\ printer\ }
134Display the status of daemons and queues on the local machine.
135.Pp
136.It Ic stop  No {\ all\ |\ printer\ }
137Stop a spooling daemon after the current job completes and disable
138printing.
139.Pp
140.It Ic topq No printer\ [\ jobnum\ ...\ ]\ [\ user\ ...\ ]
141Place the jobs in the order listed at the top of the printer queue.
142.Pp
143.It Ic up  No {\ all\ |\ printer\ }
144Enable everything and start a new printer daemon. Undoes the effects of
145.Ic down .
146.El
147.Sh FILES
148.Bl -tag -width /var/spool/output/*/lock -compact
149.It Pa /etc/printcap
150printer description file
151.It Pa /var/spool/output/*
152spool directories
153.It Pa /var/spool/output/*/lock
154lock file for queue control
155.El
156.Sh DIAGNOSTICS
157.Bl -tag -width Ds
158.It Sy "?Ambiguous command"
159abbreviation matches more than one command
160.It Sy "?Invalid command"
161no match was found
162.It Sy "?Privileged command"
163you must be a member of group "operator" or root to execute this command
164.El
165.Sh SEE ALSO
166.Xr lpq 1 ,
167.Xr lpr 1 ,
168.Xr lprm 1 ,
169.Xr printcap 5 ,
170.Xr lpd 8
171.Sh HISTORY
172The
173.Nm
174command appeared in
175.Bx 4.2 .
176