[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3


lpc Command

Note: This is a System V Print Subsystem command.

Purpose

Provides (BSD) line printer control.

Syntax

/usr/ucb/lpc [ Command [ Parameter . . . ] ]

Description

The lpc command controls the operation of the printer or of multiple printers. The lpc command can be used to start or stop a printer, disable or enable a printer's spooling queue, rearrange the order of jobs in a queue, or display the status of each printer, along with its spooling queue and printer daemon.

With no parameters, the lpc command runs interactively, prompting with lpc>. If parameters are supplied, the lpc command interprets the first as a Command to execute; each subsequent parameter is taken as a Parameter for that command. The standard input can be redirected so that the lpc command reads Commands from a file.

Commands may be abbreviated to an unambiguous substring.

Note: The printer parameter is specified just by the name of the printer (as lw), not as you would specify it to lpr or lpq (not as -Plw).

? [ Command. . . ]  
help [ Command . . . ] Displays a short description of each command specified in the parameter list or, if no parameters are given, a list of the recognized commands.
abort [ all | [ Printer . . . ] ] Terminates an active spooling daemon on the local host immediately and then disables printing (preventing new daemons from being started by lpr) for the specified printers. The abort command can only be used by a privileged user.
clean [ all | [ Printer . . . ] ] Removes all files created in the spool directory by the daemon from the specified printer queues on the local machine. The clean command can only be used by a privileged user.
disable [ all | [ Printer . . . ] ] Turns the specified printer queues off. This prevents new printer jobs from being entered into the queue by lpr. The disable command can only be used by a privileged user.
down [ all | [ Printer. . . ] ] [ Message ] Turns the specified printer queue off, disables printing, and puts Message in the printer status file. The message does not need to be quoted. The remaining parameters are treated like echo. This is normally used to take a printer down and let others know why (lpq indicates that the printer is down, as does the status command).
enable [ all | [ Printer. . . ] ] Enables spooling on the local queue for the listed printers so that lpr can put new jobs in the spool queue. The enable command can only be used by a privileged user.
exit Exits from lpc.
quit Quits from lpc.
restart [ all | [ Printer.... ] ] Attempts to start a new printer daemon. This is useful when some abnormal condition causes the daemon to die unexpectedly leaving jobs in the queue. This command can be run by any user.
start [ all | [ Printer... ] ] Enables printing and starts a spooling daemon for the listed printers. The start command can only be used by a privileged user.
status [ all | [ Printer...].] Displays the status of daemons and queues on the local machine. This command can be run by any user.
stop [ all | [ Printer... ] ] Stops a spooling daemon after the current job completes and disable printing. The stop command can only be used by a privileged user.
topq Printer [ Job#...] [ User... ] Moves the print jobs specified by Job# or those jobs belonging to User to the top (head) of the printer queue. The topq command can only be used by a privileged user.
up [ all | [ Printer...] ] Enables everything and starts a new printer daemon. Undoes the effects of down.

Files


/var/spool/lp/*  
/var/spool/lp/system/pstatus  

Error Codes


?Ambiguous command The abbreviation matches more than one command.
?Invalid command A command or abbreviation is not recognized.
?Privileged command The command can be executed only by the privileged user.
lpc: printer: unknown printer to the print service The printer was not found in the System V LP database. Usually this is a typing mistake; however, it may indicate that the printer does not exist on the system. Use lptstat -p to find the reason.
lpc: error on opening queue to spooler The connection to lpsched on the local machine failed. This usually means the printer server started at boot time has died or is hung. Check if the printer spooler daemon /usr/lib/lp/lpsched is running.
lpc: Can't send message to LP print service  
lpc: Can't receive message from LP print service Indicates that the LP print service has been stopped. Get help from the system administrator.
lpc: Received unexpected message from LP print service It is likely there is an error in this software. Get help from system administrator.

Related Information

The lpq command, lpr command, lprm command, lpsched command.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]