xref: /original-bsd/usr.sbin/lpr/lpc/lpc.8 (revision 7afc0fa3)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)lpc.8	8.3 (Berkeley) 04/19/94
7.\"
8.Dd
9.Dt LPC 8
10.Os BSD 4.2
11.Sh NAME
12.Nm lpc
13.Nd line printer control program
14.Sh SYNOPSIS
15.Nm lpc
16.Oo
17.Ar command
18.Op Ar argument ...
19.Oc
20.Sh DESCRIPTION
21.Nm Lpc
22is used by the system administrator to control the
23operation of the line printer system.
24For each line printer configured in
25.Pa /etc/printcap ,
26.Nm lpc
27may be used to:
28.Bl -bullet -offset indent
29.It
30disable or enable a printer,
31.It
32disable or enable a printer's spooling queue,
33.It
34rearrange the order of jobs in a spooling queue,
35.It
36find the status of printers, and their associated
37spooling queues and printer daemons.
38.El
39.Pp
40Without any arguments,
41.Nm lpc
42will prompt for commands from the standard input.
43If arguments are supplied,
44.Nm lpc
45interprets the first argument as a command and the remaining
46arguments as parameters to the command.  The standard input
47may be redirected causing
48.Nm lpc
49to read commands from file.
50Commands may be abbreviated;
51the following is the list of recognized commands.
52.Pp
53.Bl -tag -width Ds -compact
54.It Ic \&? No [ command ... ]
55.It Ic help No [ command ... ]
56Print a short description of each command specified in the argument list,
57or, if no argument is given, a list of the recognized commands.
58.Pp
59.It Ic abort  No {\ all\ |\ printer\ }
60Terminate an active spooling daemon on the local host immediately and
61then disable printing (preventing new daemons from being started by
62.Xr lpr )
63for the specified printers.
64.Pp
65.It Ic clean  No {\ all\ |\ printer\ }
66Remove any temporary files, data files, and control files that cannot
67be printed (i.e., do not form a complete printer job)
68from the specified printer queue(s) on the local machine.
69.Pp
70.It Ic disable  No {\ all\ |\ printer\ }
71Turn the specified printer queues off.  This prevents new
72printer jobs from being entered into the queue by
73.Xr lpr .
74.Pp
75.It Ic down No {\ all\ |\ printer\ } message ...
76Turn the specified printer queue off, disable printing and put
77.Em message
78in the printer status file. The message doesn't need to be quoted, the
79remaining arguments are treated like
80.Xr echo 1 .
81This is normally used to take a printer down and let others know why
82.Xr lpq 1
83will indicate the printer is down and print the status message).
84.Pp
85.It Ic enable  No {\ all\ |\ printer\ }
86Enable spooling on the local queue for the listed printers.
87This will allow
88.Xr lpr 1
89to put new jobs in the spool queue.
90.Pp
91.It Ic exit
92.It Ic quit
93Exit from lpc.
94.Pp
95.It Ic restart  No {\ all\ |\ printer\ }
96Attempt to start a new printer daemon.
97This is useful when some abnormal condition causes the daemon to
98die unexpectedly, leaving jobs in the queue.
99.Xr Lpq
100will report that there is no daemon present when this condition occurs.
101If the user is the super-user,
102try to abort the current daemon first (i.e., kill and restart a stuck daemon).
103.Pp
104.It Ic start  No {\ all\ |\ printer\ }
105Enable printing and start a spooling daemon for the listed printers.
106.Pp
107.It Ic status  No {\ all\ |\ printer\ }
108Display the status of daemons and queues on the local machine.
109.Pp
110.It Ic stop  No {\ all\ |\ printer\ }
111Stop a spooling daemon after the current job completes and disable
112printing.
113.Pp
114.It Ic topq No printer\ [\ jobnum\ ...\ ]\ [\ user\ ...\ ]
115Place the jobs in the order listed at the top of the printer queue.
116.Pp
117.It Ic up  No {\ all\ |\ printer\ }
118Enable everything and start a new printer daemon. Undoes the effects of
119.Ic down .
120.Sh FILES
121.Bl -tag -width /var/spool/*/lockx -compact
122.It Pa /etc/printcap
123printer description file
124.It Pa /var/spool/*
125spool directories
126.It Pa /var/spool/*/lock
127lock file for queue control
128.El
129.Sh SEE ALSO
130.Xr lpd 8 ,
131.Xr lpr 1 ,
132.Xr lpq 1 ,
133.Xr lprm 1 ,
134.Xr printcap 5
135.Sh DIAGNOSTICS
136.Bl -tag -width Ds
137.It Sy "?Ambiguous command"
138abbreviation matches more than one command
139.It Sy "?Invalid command"
140no match was found
141.It Sy "?Privileged command"
142command can be executed by root only
143.El
144.Sh HISTORY
145The
146.Nm
147command appeared in
148.Bx 4.2 .
149