1.\" $OpenBSD: lpc.8,v 1.9 2000/04/15 11:45:59 aaron 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 39.Sh NAME 40.Nm lpc 41.Nd line printer control program 42.Sh SYNOPSIS 43.Nm lpc 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. 75The standard input may 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 [ Ar command Ar ... ] 83.It Ic help No [ Ar command Ar ... ] 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 ) 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. 100This prevents new printer jobs from being entered into the queue by 101.Xr lpr . 102.Pp 103.It Xo Ic down No {\ all\ |\ printer\ } Ar message 104.Op Ar ... 105.Xc 106Turn the specified printer queue off, disable printing and put 107.Em message 108in the printer status file. 109The message doesn't need to be quoted, the 110remaining arguments are treated like 111.Xr echo 1 . 112This is normally used to take a printer down and let others know why 113.Xr lpq 1 114will indicate the printer is down and print the status message. 115.Pp 116.It Ic enable No {\ all\ |\ printer\ } 117Enable spooling on the local queue for the listed printers. 118This will allow 119.Xr lpr 1 120to put new jobs in the spool queue. 121.Pp 122.It Ic exit 123.It Ic quit 124Exit from 125.Nm lpc . 126.Pp 127.It Ic restart No {\ all\ |\ printer\ } 128Attempt to start a new printer daemon. 129This is useful when some abnormal condition causes the daemon to 130die unexpectedly, leaving jobs in the queue. 131.Xr Lpq 132will report that there is no daemon present when this condition occurs. 133If the user is the superuser, 134try to abort the current daemon first (i.e., kill and restart a stuck daemon). 135.Pp 136.It Ic start No {\ all\ |\ printer\ } 137Enable printing and start a spooling daemon for the listed printers. 138.Pp 139.It Ic status No {\ all\ |\ printer\ } 140Display the status of daemons and queues on the local machine. 141.Pp 142.It Ic stop No {\ all\ |\ printer\ } 143Stop a spooling daemon after the current job completes and disable 144printing. 145.Pp 146.It Ic topq No printer\ [\ jobnum\ ...\ ]\ [\ user\ ...\ ] 147Place the jobs in the order listed at the top of the printer queue. 148.Pp 149.It Ic up No {\ all\ |\ printer\ } 150Enable everything and start a new printer daemon. 151Undoes the effects of 152.Ic down . 153.El 154.Sh FILES 155.Bl -tag -width /var/spool/*/lockx -compact 156.It Pa /etc/printcap 157printer description file 158.It Pa /var/spool/* 159spool directories 160.It Pa /var/spool/*/lock 161lock file for queue control 162.El 163.Sh SEE ALSO 164.Xr lpq 1 , 165.Xr lpr 1 , 166.Xr lprm 1 , 167.Xr printcap 5 , 168.Xr lpd 8 169.Sh DIAGNOSTICS 170.Bl -tag -width Ds 171.It Sy "?Ambiguous command" 172Abbreviation matches more than one command. 173.It Sy "?Invalid command" 174No match was found. 175.It Sy "?Privileged command" 176You must be a member of group 177.Dq operator 178or user 179.Dq root 180to execute this command. 181.El 182.Sh HISTORY 183The 184.Nm 185command appeared in 186.Bx 4.2 . 187