Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next

ProcedureHow to Enable or Disable a Printer

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Stop printing print requests.

    # disable [-c | -W] [-r "reason"] printer-name

    disable

    Cancels the current job, then disables the printer. The current job is saved to reprint when the printer is enabled.

    -c

    Cancels the current job, then disables the printer. The current job is not printed later.

    -W

    Waits until the current job is finished before disabling the printer.

    -r "reason"

    Provides users with a reason why the printer is disabled. The reason is stored and displayed whenever a user checks on the status of the printer with the lpstat -p command.

    printer-name

    Name of the printer that will stop printing print requests.


    Note - You cannot enable or disable classes of printers. Only individual printers can be enabled or disabled.


  3. Start printing print requests.

    # enable printer-name

  4. Verify that the printer is enabled.

    $ lpstat -p printer-name

Examples--Enabling or Disabling a Printer

The following example shows how to stop the current job on the printer luna, save it to print later, and provide a reason why the printer has stopped printing print requests.

# disable -r "changing the form" luna

The following example shows how to start printing print requests on the printer luna.

# enable luna
printer "luna" enabled

Accepting or Rejecting Print Requests

The accept and reject commands enable you to turn on or turn off a print queue that stores requests to be printed.

When you use the reject command, the print queue for a specified printer is turned off. No new print requests can enter the queue on the print server. All print requests that are in the queue are still printed. You must disable the printer if you want it to stop printing requests that are already in the queue. The following table compares the functions of the accept, reject, enable, and disable commands.

Table 5-7 Functions of accept, reject, enable, and disable Commands

Command

Function

accept

Accept print requests that are sent to the print queue.

enable

Print the requests that are in the print queue.

reject

Reject print requests that are sent to the print queue.

disable

Stop printing requests that are currently in the print queue.

If a print request is rejected, the print service writes or mails a message to the user who submitted the request, saying that print requests are not being accepted for the specified printer.

You can also specify a reason for not accepting requests through the command line. The reason is displayed on users' systems when one tries to check the printer's queue. The following figure shows the point at which processing of print requests is interrupted when a print queue rejects print requests.

Figure 5-2 What Happens When a Print Queue Accepts or Rejects Requests

Illustration of a printer accepting and processing print requests and of a printer rejecting print requests, which means the print queue is blocked.

ProcedureHow to Accept or Reject Print Requests for a Printer

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Stop accepting print requests for the printer.

    # reject [-r "reason"] printer-name

    -r "reason"

    Provides users a reason why the printer is rejecting print requests. The reason is stored and displayed whenever a user checks on the status of the printer with the lpstat -p command.

    printer-name

    Name of the printer that will stop accepting print requests.

    The queued requests will continue printing as long as the printer is enabled. For instructions on disabling a printer so it stops printing, see How to Enable or Disable a Printer.

  3. Start accepting print requests for the printer.

    # accept printer-name

  4. Check that the status of the printer to see whether it is accepting or rejecting print requests.

    $ lpstat -p printer-name

Examples--Accepting or Rejecting Print Requests for a Printer

The following example shows how to stop the printer luna from accepting print requests.

# reject -r "luna is down for repairs" luna
destination "luna" will no longer accept requests

The following example shows how to set the printer luna to accept print requests.

# accept luna
destination "luna" now accepting requests

Canceling a Print Request

You can use the cancel command to cancel print requests from printer queues or to cancel jobs that are printing. Three ways to use the cancel command are as follows:

  • Cancel requests by request identification number (request ID)

  • Cancel requests from a specific user on all printers or specific printers

  • Cancel the job currently printing

When you use the cancel command, a message tells you the request(s) are canceled, and the next request in queue is printed. You can cancel a print request only if you are:

  • The user who submitted the request and you are logged in on the system from which you submitted the request

  • The user who submitted the request on any client system and the print server has the "user-equivalence" option configured for the printer in it's /etc/printers.conf file.

  • Logged in as superuser or lp or have assumed an equivalent role on the print server.

To cancel a specific request, you need to know its request ID. The request ID contains the name of the printer, a dash, and the number of the print request. For example, luna-185.

When you submit the print request, the request ID is displayed. If you do not remember the print request ID, you can find it by using the lpstat command with the -o printer option.

ProcedureHow to Cancel a Print Request

  1. If you are going to cancel print requests of other users, become superuser, lp, or assume an equivalent role.

  2. Determine the request IDs of the print requests to cancel.

    # lpstat 

    For more details, see How to Check the Status of Print Requests.

  3. Cancel a print request.

    $ cancel request-id | printer-name

    request-id

    Request ID of a print request to be canceled. You can specify multiple request IDs with this command. Use a space or a comma to separate request IDs. If you use spaces, enclose the list of request IDs in quotes.

    printer-name

    Specifies the printer for which you want to cancel the currently printing print request.

    You can specify multiple printer names with this command. Use a space or a comma to separate printer names. If you use spaces, enclose the list of printer names in quotes.

  4. Verify that the print requests are canceled.

    $ lpstat -o printer-name

Previous Previous     Contents     Index     Next Next