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.\" $FreeBSD$ 34.\" 35.Dd June 15, 2002 36.Dt LPC 8 37.Os 38.Sh NAME 39.Nm lpc 40.Nd line printer control program 41.Sh SYNOPSIS 42.Nm 43.Op Ar command Op Ar argument ... 44.Sh DESCRIPTION 45.Nm Lpc 46is used by the system administrator to control the 47operation of the line printer system. 48For each line printer configured in 49.Pa /etc/printcap , 50.Nm 51may be used to: 52.Bl -bullet -offset indent 53.It 54disable or enable a printer, 55.It 56disable or enable a printer's spooling queue, 57.It 58rearrange the order of jobs in a spooling queue, 59.It 60find the status of printers, and their associated 61spooling queues and printer daemons, 62.It 63change the status message for printer queues (the status message 64may be seen by users as part of the output of the 65.Xr lpq 1 utility). 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 76may be redirected causing 77.Nm 78to read commands from file. 79Commands may be abbreviated; 80the following is the list of recognized commands. 81.Pp 82.Bl -tag -width indent -compact 83.It Ic \&? Op Ar command ... 84.It Ic help Op Ar command ... 85Print a short description of each command specified in the argument list, 86or, if no argument is given, a list of the recognized commands. 87.Pp 88.It Ic abort Brq Cm all | Ar printer 89Terminate an active spooling daemon on the local host immediately and 90then disable printing (preventing new daemons from being started by 91.Xr lpr 1 ) 92for the specified printers. 93.Pp 94.It Ic clean Brq Cm all | Ar printer 95Remove any temporary files, data files, and control files that cannot 96be printed (i.e., do not form a complete printer job) 97from the specified printer queue(s) on the local machine. 98This command will also look for 99.Pa core 100files in spool directory 101for each printer queue, and list any that are found. 102It will not remove any 103.Pa core 104files. 105See also the 106.Ic tclean 107command. 108.Pp 109.It Ic disable Brq Cm all | Ar printer 110Turn the specified printer queues off. 111This prevents new 112printer jobs from being entered into the queue by 113.Xr lpr 1 . 114.Pp 115.It Ic down Bro Cm all | Ar printer ... Brc Cm -msg Ar message ... 116.It Ic down Bro Cm all | Ar printer Brc Ar message ... 117Turn the specified printer queue off, disable printing and put 118.Ar message 119in the printer status file. 120When specifying more than one printer queue, the 121.Ic -msg 122argument is required to separate the list of printers from the text 123that will be the new status message. 124The message doesn't need to be quoted, the 125remaining arguments are treated like 126.Xr echo 1 . 127This is normally used to take a printer down, and let other users 128find out why it is down (the 129.Xr lpq 1 130utility will indicate that the printer is down and will print the 131status message). 132.Pp 133.It Ic enable Brq Cm all | Ar printer 134Enable spooling on the local queue for the listed printers. 135This will allow 136.Xr lpr 1 137to put new jobs in the spool queue. 138.Pp 139.It Ic exit 140.It Ic quit 141Exit from 142.Nm . 143.Pp 144.It Ic restart Brq Cm all | Ar printer 145Attempt to start a new printer daemon. 146This is useful when some abnormal condition causes the daemon to 147die unexpectedly, leaving jobs in the queue. 148.Xr lpq 1 149will report that there is no daemon present when this condition occurs. 150If the user is the super-user, 151try to abort the current daemon first (i.e., kill and restart a stuck daemon). 152.Pp 153.It Ic setstatus Bro Cm all | Ar printer Brc Cm -msg Ar message ... 154Set the status message for the specified printers. 155The 156.Ic -msg 157argument is required to separate the list of printers from the text 158that will be the new status message. 159This is normally used to change the status message when the printer 160queue is no longer active after printing has been disabled, and you 161want to change what users will see in the output of the 162.Xr lpq 1 utility. 163.Pp 164.It Ic start Brq Cm all | Ar printer 165Enable printing and start a spooling daemon for the listed printers. 166.Pp 167.It Ic status Brq Cm all | Ar printer 168Display the status of daemons and queues on the local machine. 169.Pp 170.It Ic stop Brq Cm all | Ar printer 171Stop a spooling daemon after the current job completes and disable 172printing. 173.Pp 174.It Ic tclean Brq Cm all | Ar printer 175This will do a test-run of the 176.Ic clean 177command. 178All the same checking is done, but the command will only print out 179messages saying what a similar 180.Ic clean 181command would do if the user typed it in. 182It will not remove any files. 183Note that the 184.Ic clean 185command is a privileged command, while the 186.Ic tclean 187command is not restricted. 188.Pp 189.It Ic topq Ar printer Xo 190.Op Ar jobnum ... 191.Op Ar user ... 192.Xc 193Place the jobs in the order listed at the top of the printer queue. 194.Pp 195.It Ic up Brq Cm all | Ar printer 196Enable everything and start a new printer daemon. 197Undoes the effects of 198.Ic down . 199.El 200.Sh FILES 201.Bl -tag -width /var/spool/*/lockx -compact 202.It Pa /etc/printcap 203printer description file 204.It Pa /var/spool/* 205spool directories 206.It Pa /var/spool/*/lock 207lock file for queue control 208.El 209.Sh SEE ALSO 210.Xr lpq 1 , 211.Xr lpr 1 , 212.Xr lprm 1 , 213.Xr printcap 5 , 214.Xr chkprintcap 8 , 215.Xr lpd 8 216.Sh DIAGNOSTICS 217.Bl -diag 218.It "?Ambiguous command" 219abbreviation matches more than one command 220.It "?Invalid command" 221no match was found 222.It "?Privileged command" 223you must be a member of group "operator" or root to execute this command 224.El 225.Sh HISTORY 226The 227.Nm 228command appeared in 229.Bx 4.2 . 230