Next | Prev | Up | Top | Contents | Index

Administrator Command Summary

This section summarizes the commands that are used to administer the lp system. To execute the administrative commands, you must be logged in as either root (that is, the superuser) or as lp. Inexperienced users should not use the lp administrative commands.

lpsched

Starts the lp scheduler

lpshut

Stops the lp scheduler

reject

Prevents jobs from queueing at a particular destination

accept

Permits job requests to queue at a particular destination

lpmove

Moves job requests from one destination to another

lpadmin

Configures the lp system

lpsched: Start the lp Scheduler

The lpsched command starts the lp scheduler, the background daemon responsible for scheduling lp requests. lp prints jobs only when the scheduler is running on that system. lpsched is executed automatically each time the computer is booted.

Every time lpsched is executed, it creates a file called SCHEDLOCK in /var/spool/lp. When the scheduler is stopped under normal conditions, SCHEDLOCK is automatically removed. As long as this file exists, the system does not allow another lp scheduler process to run. If the scheduler stops abnormally (for example, if the system shuts down abnormally) you must remove SCHEDLOCK before you use the lpsched command.

To start the lp scheduler, type:

/usr/lib/lpsched

There is no response from the system to acknowledge the lpsched command; to verify that the scheduler is running, use lpstat.


lpshut: Stop the lp Scheduler

The lpshut command stops the lp scheduler and ends all printing activity. All requests that are being printed when you issue the lpshut command are reprinted in their entirety when the scheduler is restarted.

To stop the lp scheduler, type:

/usr/lib/lpshut


reject: Prevent Print Requests

The reject command stops lp from routing requests to a destination queue. For example, if a printer has been removed for repairs, or has received too many requests, you may wish to prevent new jobs from being queued at that destination.

If the printer is enabled, all requests that are in the queue when you issue the reject command are printed.

The reject command takes the form:

/usr/lib/reject [-r"reason"] destination

Use the -r option to tell other users why print requests are being rejected. reason is a character string and is enclosed in double quotation marks (" "). This string is reported to anyone trying to use lp to send requests to the specified destination.


accept: Allow Print Requests

The accept command allows job requests to be placed in a queue at the named printer(s) or class(es) of printer(s). As shown in Example 2-6, accept allows a printer to receive job requests, and reject disables printing:

Example 2-6 : Using the accept and reject Commands

/usr/lib/accept myprinter destination "myprinter" now accepting requests

/usr/lib/reject -r"printer broken" myprinter destination "myprinter" is no longer accepting requests


lpmove: Move a Request to Another Printer

The lpmove command moves print requests from one destination to another. For example, if you have a printer removed for repairs, you may want to move all jobs pending on the queue to a destination with a working printer. You may also use lpmove to move specific requests from one destination to another, but only after you have halted the scheduler with the lpshut command. lpmove automatically rejects job requests rerouted to a destination without a printer. The lpmove command takes two forms:

/usr/lib/lpmove dest1 dest2

/usr/lib/lpmove request(s) destination

dest1, dest2, and destination are printers or classes of printers. request is a specific
request ID.

In the first form of the command, all requests are moved from dest1 to dest2. After the move, the printer or printers at dest1 do not accept requests until you issue an accept command. All rerouted requests are renamed dest2-nnn, where nnn is a new sequence number in the queue for destination dest2. In the second form, which you can issue only after you stop the scheduler, the rerouted requests are renamed destination-nnn. When you restart the scheduler, the original destinations still accept new requests. The three commands in Example 2-7 demonstrate the use of the lpmove command.

Example 2-7 : Using the lpmove and lpshut Commands

/usr/lib/lpmove myprinter yourprinter

lpshut

/usr/lib/lpmove foo-19 foo-20 yourprinter total of 2 requests moved to yourprinter


lpadmin: Configure Printers

The lpadmin command has two primary uses:

Unlike most IRIX commands, lpadmin requires an option. The lpadmin command takes three forms:

lpadmin -ddestination

lpadmin -xdestination

lpadmin -pprinter [options]

In Example 2-8, the first entry shuts down the lp scheduler. The second entry removes the printer myprinter from the lp spooling system. The printer myprinter is then removed from the foo class and assigned to the boo class with the third entry.

Example 2-8 : Using the lpadmin Command

/usr/lib/lpshut

/usr/lib/lpadmin -xmyprinter

/usr/lib/lpadmin -pmyprinter -rfoo -cboo

For a complete list of options, see the lpadmin(1M) reference page.


Next | Prev | Up | Top | Contents | Index