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