Cover V04, I01
Article
Listing 1
Sidebar 1
Sidebar 2
Sidebar 3

jan95.tar


Sidebar: Using lpc

lpc controls printer operations on the network. With its various commands it can start or stop a printer, enable or disable the printing queues for a particular printer, rearrange print jobs within the printing queue, and display the status of each printer on the network, along with printing queue and printer daemon information.

You may use lpc either from the command line or interactively. When lpc is executed from the command line with one or more arguments, the first argument is interpreted as a command. Each argument thereafter is taken as a parameter to this command. For example:

% lpc down laser3 Laser 3 is down for maintenance

In this example, down is the command that lpc will execute. The down command turns off the print queue and disables printing for a particular printer on the network -- in this case "laser3." The next parameter is actually a message. This message will be displayed if anyone inquires about laser3 in an attempt to use the printer. Notice that the message is not enclosed within quotes.

If you invoke lpc with no arguments, it runs interactively. The shell prompt will be replaced with the following lpc prompt:

lpc>

Simply type the command you wish to execute followed by any necessary parameters. When you're ready to leave the interactive prompt, type "exit," "quit," or simply "q" to exit lpc and return to the shell prompt.

Following is a list of some other useful commands recognized by lpc and a description of the task each command performs. Like the command "quit," all lpc commands can be abbreviated. If lpc is not sure which command you are trying to specify, it will display, "?Ambiguous command."

up [ all | [ printername...]]

This command is the exact opposite of the down command. It restarts all queues or the specified queues, enables printing again, and removes the message from the printer status file.

disable [ all | [ printername...]]

This command is similar to the down command except that it can only be used by the superuser and doesn't give the option of adding a message to the printer status file.

enable [ all | [ printername...]]

This command reverses the disable command and is also only available to the superuser.

restart [ all | [ printername...]]

This handy command is available to all users. If the printer daemon dies for some unknown reason, this command will try to restart it. You will find out that the printer daemon died when you use lpq to check on your print job. lpq will notify you that the printer daemon is not present.

topq printername [ jobnumber...] [ username...]

This command is also handy, but is available only to the super-user. The command will take the specified print jobs, or all the print jobs belonging to the specified user, and move them to the top of the print queue ahead of all other jobs in the queue.

clean [ all | [ printername...]]

This command removes all print jobs from all the printers or the specified printers. It is only available to the superuser.

status [ all | [ printername...]]

This command simply displays the status of the printer daemons and queues; it is available to all users.

help [command] ...

This is probably the most important command. Typed without an argument, it displays a list of all recognized lpc commands. If commands are specified, it will display a short description of the task performed by each.