When a user submits a print request from a print client, the print request is added to a queue on the print server before it is sent to the printer. While a print request is in the queue, you can cancel or gain status information on the request from a client system. You must login to the print server to move, hold, resume, or change the priorities of print requests with LP commands. These actions can help you keep printing services operating smoothly.
The table below lists the values for changing the priority of a print request with the lp -H command.
Table 5-6 Values for Changing the Priority of a Print Request
Value for -H change-priority |
Description |
---|---|
hold |
Places the print request on hold until you cancel it or instruct the LP print service to resume printing the request. |
resume |
Places a print request that has been on hold back in the queue. It will be printed according to its priority and placement in the queue. If you put a hold on a print job that is already printing, resume puts the print request at the head of the queue so it becomes the next request printed. |
immediate |
Places a print request at the head of the queue. If a request is already printing, you can put it on hold to allow the next request to print immediately. |
Log in on any system on the network.
Check the status of printers and print requests by using the lpstat command.
Only the most commonly used options are shown here. See lpstat(1) for other valid options.
$ lpstat -o [list] | -u [user-list] |
When used to check the status of print requests, the lpstat command displays one line for each print request. From left to right, the line shows the request ID, the user, the output size in bytes, the date and time of the request, and information about the request, such as "being filtered."
In the following example, the command shows that user fred has one print request queued to the printer luna.
$ lpstat luna-1 fred 1261 Jul 12 17:34 |
In the following example, the command shows that the user paul currently has no print requests in queue.
$ lpstat -u paul |
In the following example, the command shows that there are two print requests on the printer moon.
$ lpstat -o moon moon-78 root 1024 Jul 14 09:07 moon-79 root 1024 Jul 14 09:08 |
The enable(1) and disable(1) commands control whether a printer prints or stops printing requests that are in the print queue. When you disable a printer, the printer stops printing requests in queue; however, requests are still added to the queue. (You must set the printer to reject print requests so requests are not added to the queue. See "Accepting or Rejecting Print Requests" for information about rejecting print requests.)
A printer is enabled to print and accepts print requests when it is added using Solaris Print Manager. Solaris Print Manager doesn't provide any additional printer processing management.
You must enable the printer whenever it has been disabled, which can happen when a printer fault occurs. When you enable a printer, it prints requests from the print queue until the queue is empty, even if the print service rejects additional requests for the print queue.
The figure below shows the point at which processing of print requests is interrupted when a printer is disabled.
Stop accepting print requests for the printer by using the reject(1M) command.
# 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 (lpstat -p). |
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 by using the accept(1M) command.
# accept printer-name |
Check the status of the printer to see whether it is accepting or rejecting print requests by using the lpstat command.
$ lpstat -p printer-name |
In the following example, the command stops the printer luna from accepting print requests.
# reject -r "luna is down for repairs" luna destination "luna" will no longer accept requests |
In the following example, the command sets the printer luna to accept print requests.
# accept luna destination "luna" now accepting 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. Table 5-7 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. |
See "Processing or Stopping Printing" for information about disabling a printer.
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 figure below shows the point at which processing of print requests is interrupted when a print queue rejects print requests.
Stop printing print requests on the printer by using the disable command.
# disable [-c | -W] [-r "reason"] printer-name |
You cannot enable or disable classes of printers. Only individual printers can be enabled or disabled.
Start printing print requests on the printer by using the enable command.
# enable printer-name |
Verify the printer is enabled.
$ lpstat -p printer-name |
In the following example, the command stops the current job on the printer luna, saves it to print later, and provides a reason why the printer has stopped printing print requests.
# disable -r "changing the form" luna |
In the following example, the command starts printing print requests on the printer luna.
# enable luna printer "luna" enabled |
You can use the cancel(1) 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 cancel, 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 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.
If you are going to cancel print requests of other users, become superuser or lp.
Determine the request IDs of the print requests to cancel by using the lpstat command.
See "How to Check the Status of Print Requests" for more details.
Cancel a print request by using the cancel command.
$ cancel request-id | printer-name |
Verify the print requests are canceled.
$ lpstat -o printer-name |
In the following example, the command cancels the luna-3 and luna-4 print requests.
$ cancel luna-3 luna-4 request "luna-3" cancelled request "luna-4" cancelled |
In the following example, the command cancels the print request that is currently printing on the printer luna.
# cancel luna request "luna-9" cancelled |
(Optional) Become superuser or lp if you are going to cancel print requests of other users.
Cancel a print request from a specific user with the cancel command.
$ cancel -u user-list [printer-name] |
In the following example, the command cancels all the print requests submitted by the user george on the printer luna.
# cancel -u george luna request "luna-23" cancelled |
In the following example, the command cancels all the print requests submitted by the user george on all printers.
# cancel -u george request "asteroid-3" cancelled request "luna-8" cancelled |
If you plan to change the way a printer is used or decide to take a printer out of service, you should set up the LP print service to reject additional print requests, and then move or cancel any requests that are currently queued to the printer. You can use the lpmove(1M) command to move individual or all print requests to another local printer.
Request IDs are not changed when you move print requests, so users can still find their requests. Print requests that have requirements (such as file content type or forms) that cannot be met by the newly specified printer cannot be moved; they must be canceled.
To move all print requests from one printer to another, you do not need to know the request IDs; however, it is a good idea to see how many print requests are affected before you move them.
Log in as superuser or lp on the print server.
(Optional) Check the request IDs of the print requests on the original printer.
# lpstat -o printer-name1 |
(Optional) Check if the destination printer is accepting print requests.
# lpstat -p printer-name2 |
-p printer-name2 |
Name of the printer to which you are moving the print requests. |
Move all the print requests from the original printer to the destination printer.
# lpmove printer-name1 printer-name2 |
printer-name1 |
Name of the printer from which all print requests will be moved. |
printer-name2 |
Name of the printer to which all print requests will be moved. |
If some requests cannot be printed on the destination printer, they are left in the original printer's queue. By using request IDs, you can also move specific print requests to another printer with the lpmove command.
Start accepting print requests on the original printer.
If you move all the print requests to another printer, the lpmove command automatically stops accepting print requests for the printer. This step is necessary if you want to begin accepting new print requests for the printer.
# accept printer-name1 |
Check for any remaining print requests in the original printer's queue by using the following command.
$ lpq -P printer-name1 |
Make sure all specified print requests were moved to the destination printer's queue by using the following command.
$ lpq -P printer-name2 |
In the following example, the lpmove command moves print requests from the printer luna to the printer terra, and the accept command tells the original printer luna to resume accepting print requests.
# lpmove luna terra # accept luna |
After a user has submitted a print request, you can change its priority in the print server's queue by:
Putting any print request on hold if it has not finished printing. Putting a request on hold stops it, if it is currently printing, and keeps it from printing until you resume printing it. Other print requests go ahead of the on-hold request.
Moving any print request to the head of the queue, where it will be the next job eligible for printing. If you want a job to start printing immediately, you can interrupt the job that is currently printing by putting it on hold.
Changing the priority of a job still waiting to be printed, moving it in the queue so it is ahead of lower priority requests and behind requests at the same level or at a higher priority.
Log in as superuser or lp on the print server that is holding the print request.
Determine the request IDs of the print requests whose priority you want to change by using the lpstat command.
See "How to Check the Status of Print Requests" for more information.
Change the priority of a print request by using the lp command.
# lp -i request-id -H change-priority |
-i request-id |
Request ID of a print request you want to change. 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. |
-H change-priority |
One of the three ways to change the priority of a print request: hold, resume, immediate. See Table 5-6 for detailed information about valid values for change-priority. |
You can also use the lp -q command to change the priority level of a specified print request. You can change the priority level from 0, the highest priority, to 39, the lowest priority.
In the following example, the command changes a print request with the request ID asteroid-79, to priority level 1.
# lp -i asteroid-79 -q 1 |