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 and enable/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
How to Accept or Reject Print Requests for a Printer
Log in as superuser, lp, or assume an equivalent role on the print server.
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".
Start accepting print requests for the printer.
# accept printer-name
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. There are three ways to use the cancel command:
Cancel requests by request identification number (request ID)
Cancel requests from a specific user on all, or specified, 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 is comprised of 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.
How to Cancel a Print Request
If you are going to cancel print requests of other users, become superuser, lp, or assume an equivalent role.
Determine the request IDs of the print requests to cancel.
# lpstat
For more details, see "How to Check the Status of Print Requests".
Cancel a print request.
$ cancel request-id | printer-name
Verify that the print requests are canceled.
$ lpstat -o printer-name
Examples--Canceling a Print Request
The following example shows how to cancel the luna-3 and luna-4 print requests.
$ cancel luna-3 luna-4 request "luna-3" cancelled request "luna-4" cancelled |
The following example shows how to cancel the print request that is currently printing on the printer luna.
# cancel luna request "luna-9" cancelled |
How to Cancel a Print Request From a Specific User
(Optional) Become superuser, lp, or assume an equivalent role if you are going to cancel print requests of other users.
Cancel a print request from a specific user.
$ cancel -u user-list [printer-name]
Examples--Canceling a Print Request From a Specific User
The following example shows how to cancel all the print requests submitted by the user george on the printer luna.
# cancel -u george luna request "luna-23" cancelled |
The following example shows how to cancel all the print requests submitted by the user george on all printers.
# cancel -u george request "asteroid-3" cancelled request "luna-8" cancelled |