|
| 以 PDF 格式下載這本書
Administering Printers
49
- This chapter provides the procedures to administer printers. This is a list of the step-by-step instructions in this chapter.
-
- For overview information about printing and the LP print service, see Chapter 47, "Overview of Print Management."
Managing Printers and the Print Scheduler
- This section provides instructions for day-to-day tasks you perform to manage printers and the print scheduler.
· How to Delete a Printer and Remote Printer Access
-
-
Log in as root or lp on a print client that has access to the printer you want to delete.
-
Delete information about the printer from the print client.
-
print-client# lpadmin -x printer-name
|
- In this command,
-
printer-name..Is the name of the printer you want to delete.
- Information for the specified printer is deleted from the print client's /etc/lp/printers directory.
-
-
If the print client does not use another printer on the same print server, delete information about the print server from the print client.
-
print-client# lpsystem -r print-server
|
- In this command,
-
print-server...Is the name of the print server you want to delete.
- The print server is deleted from the print client's /etc/lp/Systems file.
-
-
Repeat Step 1 through Step 3 on each print client that has access to the printer.
-
-
Log in as root or lp on the print server.
-
Stop accepting print requests on the printer.
-
print-server# reject printer-name
|
- In this command,
-
printer-name..Is the name of the printer you want to delete.
- This step prevents any new requests from entering the printer's queue while you are in the process of removing the printer. See "How to Accept or Reject Print Requests for a Printer" on page 951 for a detailed description.
-
-
Stop the printer.
-
print-server# disable printer-name
|
- This step stops print requests from printing. See "How to Enable or Disable a Printer" on page 953 for a detailed description on how to stop printing.
-
-
Move any print requests that are still in the queue to another printer.
See "How to Move Print Requests to Another Printer" on page 957 for a detailed description on how to move print requests to another printer.
-
Delete the printer from the print server.
-
print-server# lpadmin -x printer-name
|
- Configuration information for the printer is deleted from the print server's /etc/lp/printers directory.
-
-
Delete information about the print clients that were using the printer you just deleted, unless they are still using another printer on the print server.
-
print-server# lpsystem -r print-client1 [,print-client2...]
|
- In this command,
-
print-client...Is the name of the print client you want to delete from the print server.
- You can specify multiple print clients in this command. Use a space or a comma to separate print client names. If you use spaces, enclose the list of print clients in quotes.
- The specified print clients are deleted from the print server's /etc/lp/Systems file.
Verification--Deleting a Printer and Remote Printer Access
- On the print client, make sure that the information for the printer has been deleted. You should receive an error indicating that the printer does not exist in the output of the following command.
-
print-client$ lpstat -p printer-name -l
|
- On the print server, make sure that the configuration information for the printer has been deleted. You should receive an error indicating that the printer does not exist in the output of the following command.
-
print-server$ lpstat -p printer-name -l
|
- Verify that any print clients that will no longer use the print server have been deleted from the server. The print clients should not be listed in the output of the following command.
-
print-server# lpsystem -l
|
- Otherwise, submit a print request to the printer from a deleted print client. You should receive an error message stating that the destination printer is unknown to the LP print service.
Example--Deleting a Printer and Remote Printer Access
- In the following example, the commands delete the printer luna from the print client terra and from the print server jupiter, and also delete the print client terra from the print server.
-
terra# lpadmin -x luna
Removed "luna".
jupiter# lpadmin -x luna
jupiter# lpsystem -r terra
Removed "terra".
|
· How to Check the Status of Printers
-
-
Log in on any system on the network.
-
Check the status of printers by using the lpstat command. Only the most commonly used options are shown here. See the lpstat(1) man page for other options.
-
$ lpstat [-d] [-p printer-name [-D] [-l]] [-t]
|
- In this command,
-
-d.......Shows the system's default printer.
-
-p printer-name Shows if a printer is active or idle, when it was enabled or disabled, and whether it is accepting print requests.
- 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.
- If you don't specify printer-name, the status of all printers is displayed.
-
| -D | Shows the description of the specified printer-name. |
| -l | Shows the characteristics of the specified printer-name. |
| -t | Shows status information about the LP print service, including the status of all printers: whether they are active and whether they are accepting print requests. |
Examples--Checking the Status of Printers
- In the following example, the command requests the name of the system's default printer.
-
$ lpstat -d
system default destination: luna
|
- In the following example, the command requests the status of the printer luna.
-
$ lpstat -p luna
printer luna is idle. enabled since Wed Oct 12 10:28:33 MDT 1995. available.
|
- In the following example, the command requests a description of the printers asteroid and luna.
-
$ lpstat -p "asteroid luna" -D
printer asteroid faulted. enabled since Tue Nov 1 12:41:17 MST 1995. available.
unable to print: paper misfeed jam
Description: Printer by break room.
printer luna is idle. enabled since Tue Nov 1 12:41:17 MST 1995. available.
Description:
|
- In the following example, the command requests the characteristics of the printer luna.
-
$ lpstat -p luna -l
printer luna is idle. enabled since Tue Aug 30 11:05:33 MDT 1995. available.
Content types: any
Printer types: unknown
Description:
Users allowed:
(all)
Forms allowed:
(none)
Banner not required
Character sets:
(none)
Default pitch:
Default page size:
|
· How to Stop the Print Scheduler
-
-
Log in as root or lp on the print server.
-
Check to see if the print scheduler is running.
-
- If the print scheduler is not running, the message scheduler is not running is displayed.
-
-
If the print scheduler is running, stop it.
-
· How to Restart the Print Scheduler
-
-
Log in as root or lp on the print server.
-
Check to see if the print scheduler is running.
-
- If the print scheduler is not running, the message scheduler is not running is displayed.
-
-
If the print scheduler is not running, start it.
-
Setting Print Definitions
- See "Setting Definitions for Printers" on page 870 for more information on setting print definitions.
-
Table 49-1 lists the fault recovery values you can set for a printer with the lpadmin -F command. See "Fault Recovery" on page 882 for more information.
-
Table 49-1
| Value for -F recover-options | Description |
| beginning | After a fault recovery, printing restarts from the
beginning of the file. |
| continue | After a fault recovery, printing starts at the top of the page where the printing stopped. This recovery option requires a print filter. |
| wait | After a fault recovery, printing stops until you enable the printer. After you enable the printer (enable command), printing starts at the top of the page where printing stopped. This recovery option requires a print filter. |
-
Table 49-2 lists the alert values that you can set for a printer with the lpadmin -A command. These alert values can also be set for print wheels, font cartridges, and forms. See "Fault Notification" on page 878 for more information.
-
Table 49-2
| Value for -A alert | Description |
| 'mail [user-name]' | Send the alert message by email to root or lp on the print
server, or the specified user-name, which is a name of a user. |
| 'write [user-name]' | Send the alert message to the root or lp console window on the print server, or to the console window of the specified user-name, which is a name of a user. The specified user must be logged in to the print server to get the alert message. |
-
Table 49-2 (Continued)
| Value for -A alert | Description |
| 'command' | Run the command file for each alert. The environment variables and current directory are saved and restored when the file is executed. |
| quiet | Stop alerts until the fault is fixed. Use this when you (root or specified user) receive repeated alerts. |
| none | Do not send any alerts. This is the default if you don't specify fault alerts for a printer. |
-
Table 49-3 lists the values you can add to an allow or deny list to limit user access to a printer. See "Limiting User Access to a Printer" on page 880 for more information.
-
Table 49-3
| Value for user-list | Description |
| user | User on any system |
| all | All users on all systems |
| none | No user on any system |
| system!user | User on system only |
| !user | User on local system only |
| all!user | User on any system |
| all!all | All users on all systems |
| system!all | All users on system |
| !all | All users on local system |
· How to Add a Printer Description
-
-
Log in as root or lp on the print server.
-
Add a printer description by using the lpadmin command.
-
# lpadmin -p printer-name -D "comment"
|
- In this command,
-
| printer-name | Is the name of the printer for which you are adding a description. |
| comment | Specifies the characteristics of the printer, such as location or administrative contact. Enclose characters that the shell might interpret (like *, ?, \, !, ^) in single quotation marks. |
- The printer description is added in the print server's /etc/lp/printers/printer-name/comment file.
Verification--Adding a Printer Description
- Check the information following the Description heading in the output of the following command.
-
$ lpstat -p printer-name -l
|
Example--Adding a Printer Description
- In the following example, the command adds a printer description for the printer luna.
-
# lpadmin -p luna -D "Nathans office"
|
· How to Set a System's Default Printer
-
-
Log in as root or lp on the system for which you want to set a default printer.
-
Set the system's default printer by using the lpadmin command.
-
# lpadmin -d [printer-name]
|
- In this command,
-
printer-name..Is the name of the printer you are assigning as the system's default printer. If you don't specify printer-name, the system is set up with no default printer.
- The default printer name is entered in the system's /etc/lp/default file.
Verification--Setting a System's Default Printer
- Check the system's default printer by using the lpstat command.
-
Example--Setting a System's Default Printer
- In the following example, the command sets the printer luna as the system's default printer. This means that luna will be used as the system's default printer if the LPDEST or PRINTER environment variables are not set.
-
# lpadmin -d luna
# lpstat -d
system default destination: luna
|
· How to Make Banner Pages Optional
-
-
Log in as root or lp on the print server.
-
Make banner pages optional by using the lpadmin command.
-
# lpadmin -p printer-name -o nobanner
|
- In this command,
-
| printer-name | Is the name of the printer for which you are making banner pages optional. |
| -o nobanner | Enables users to specify no banner page when they submit a print request. |
- If you want to force a banner page to print with every print request, specify the -o banner option.
- The banner page setting is entered in the print server's /etc/lp/printers/printer-name/configuration file.
Verification--Making Banner Pages Optional
- The output from the following command should contain the line Banner not required.
-
$ lpstat -p printer-name -l
|
Example--Making Banner Pages Optional
- In the following example, the command enables users to request no banner page on the printer luna.
-
# lpadmin -p luna -o nobanner
|
· How to Turn Off Banner Pages
-
-
Log in as root or lp on the print server.
-
Change directory to the /etc/lp/interfaces directory.
-
-
-
Edit the file that has the name of the printer for which you want to turn off banner pages.
-
Change the nobanner variable to yes.
-
- Change the nobanner variable to no if you want to turn banner pages on again.
- The banner page setting is entered in the print server's /etc/lp/printers/printer-name/configuration file.
Verification--Turning Off Banner Pages
- Submit a print request to the printer to make sure a banner page does not print.
· How to Define a Class of Printers
-
-
Log in as root or lp on the print server.
-
Define a class of printers by using the lpadmin command.
-
# lpadmin -p printer-name -c printer-class
|
- In this command,
-
| printer-name | Is the name of the printer you are adding to a class of printers. |
| printer-class | Is the name of a class of printers. |
- The specified printer is added to the end of the list in the class in the print server's /etc/lp/classes/printer-class file. If the printer class does not exist, it is created.
Verification--Defining a Class of Printers
- List the printers in a printer class by using the lpstat command.
-
$ lpstat -c printer-class
|
Example--Defining a Class of Printers
- In the following example, the command adds the printer luna in the class roughdrafts.
-
# lpadmin -p luna -c roughdrafts
|
· How to Set Printer Fault Recovery
-
-
Log in as root or lp on the print server.
-
Set up fault recovery for the printer with the lpadmin command.
-
# lpadmin -p printer-name -F recovery-options
|
- In this command,
-
| printer-name | Is the name of the printer for which you are specifying fault recovery. |
| recovery-options | Is one of the three valid recovery options: beginning, continue, or wait. |
- See Table 49-1 on page 937 for detailed information about the valid values for recovery-options.
- The fault recovery setting is entered in the print server's /etc/lp/printers/printer-name/configuration file.
Verification--Setting Printer Fault Recovery
- Check the information following the After fault heading in the output of the following command.
-
$ lpstat -p printer-name -l
|
Example--Setting Printer Fault Recovery
- In the following example, the command sets up the printer luna to continue printing at the top of the page where printing stopped.
-
# lpadmin -p luna -F continue
|
· How to Set Fault Alerts for a Printer
-
-
Log in as root or lp on the print server.
-
Set fault alerts for a printer with the lpadmin command.
-
# lpadmin -p printer-name -A alert [-W minutes]
|
- In this command,
-
printer-name Is the name of the printer for which you are specifying an alert for printer faults.
-
| alert | Specifies what kind of alert will occur when the printer faults. See Table 49-2 on page 937 for detailed information about the valid values for alert. Some valid values are mail, write, and quiet. |
| minutes | Specifies how often (in minutes) the fault alert will occur. If you don't specify this option, the alert is sent once. |
- The fault alert setting is entered in the print server's /etc/lp/printers/printer-name/alert.sh file.
Verification--Setting Fault Alerts for a Printer
- Check the information following the On fault heading from the output of the following command.
-
$ lpstat -p printer-name -l
|
Examples--Setting Fault Alerts for a Printer
- In the following example, the command sets up the printer mars to send fault alerts by email to a user named joe, with reminders every 5 minutes.
-
# lpadmin -p mars -A 'mail joe' -W 5
|
- In the following example, the command sets up the printer venus to send fault alerts to the console window, with reminders every 10 minutes.
-
# lpadmin -p venus -A write -W 10
|
- In the following example, the command stops fault alerts for the printer mercury.
-
# lpadmin -p mercury -A none
|
- In the following example, the command stops fault alerts until the printer venus has been fixed.
-
# lpadmin -p venus -A quiet
|
· How to Limit User Access to a Printer
-
-
Log in as root or lp on the print server.
-
Allow or deny users access to a printer by using the lpadmin command.
-
# lpadmin -p printer-name -u allow:user-list | deny:user-list
|
- In this command,
-
| printer-name | Is the name of the printer to which the allow or deny user access list applies. |
| user-list | Represents user names to be added to the allow or deny user access list. |
- You can specify multiple user names with this command. Use a space or a comma to separate names. If you use spaces, enclose the list of names in quotes.
-
Table 49-3 on page 938 provides the valid values for user-list.
- The specified users are added to the allow or deny user access list for the printer in one of the following files on the print server:
-
-
/etc/lp/printers/printer-name/users.allow
//etc/lp/printers/printer-name/users.deny
-
Note - If you specify none as the value for user-list in the allow user access list, the following files are not created for the print server:
-
-
/etc/lp/printers/printer-name/alert.sh
/etc/lp/printers/printer-name/alert.var
/etc/lp/printers/printer-name/users.allow
/etc/lp/printers/printer-name/users.deny
Verification--Limiting User Access to a Printer
- Check the information following the Users allowed or Users denied heading in the output of the following command.
-
$ lpstat -p printer-name -l
|
Examples--Limiting User Access to a Printer
- In the following example, the command allows only the users nathan and george access to the printer luna.
-
# lpadmin -p luna -u allow:nathan,george
|
- In the next example, the command denies the users nathan and george access to the printer asteroid.
-
# lpadmin -p asteroid -u deny:"nathan george"
|
Managing Print Requests
- If you need overview information on managing print requests, see "Managing Print Requests" on page 884.
-
Table 49-4 lists the values for changing the priority of a print request with the lp -H command. See "Changing the Priority of Print Requests" on page 885 if you need further information.
-
Table 49-4
| 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. |
· How to Check the Status of Print Requests
-
-
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 the lpstat(1) man page for other valid options.
-
$ lpstat -o [list] | -u [user-list]
|
- In this command,
-
-o list.....Shows the status of print requests on a specific printer. list can be one or more printer names, printer class names, or print request IDs.
- You can specify multiple printer names, class names, and IDs for list. Use a space or a comma to separate values. If you use spaces, enclose the list of values in quotes.
- If you don't specify list, the status of print requests to all printers is displayed.
-
-u user-list...Shows the status of print requests for a specific user. user-list can be one or more user names.
- You can specify multiple users with this command. Use a space or a comma to separate user names. If you use spaces, enclose the list of names in quotes.
- If you don't specify user-list, the status of print requests for all users is displayed.
- 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."
Examples--Checking the Status of Print Requests
- In the following example, the command shows that user fred has one print request queued to the printer luna.
-
$ lpstat
luna-1 fred 1261 Mar 12 17:34
|
- In the following example, the command shows that the user paul currently has no print requests in queue.
-
- In the following example, the command shows that there are two print requests on the printer moon.
-
$ lpstat -o moon
moon-78 root 1024 Jan 14 09:07
moon-79 root 1024 Jan 14 09:08
|
· How to Accept or Reject Print Requests for a Printer
-
-
Log in as root or lp on the print server.
-
Stop accepting print requests for the printer by using the reject command.
-
# reject [-r "reason"] printer-name
|
- In this command,
-
| -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 | Is the 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" on page 953.
-
-
Start accepting print requests for the printer by using the accept command.
-
Verification--Accepting or Rejecting Print Requests for a Printer
- Check the status of the printer to see whether it is accepting or rejecting print requests by using the lpstat command.
-
Examples--Accepting or Rejecting Print Requests for a Printer
- 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
|
· How to Enable or Disable a Printer
-
-
Log in as root or lp on the print server.
-
Stop printing print requests on the printer by using the disable command.
-
# disable [-c | -W] [-r "reason"] printer-name
|
- In this command,
-
| disable | With no options, 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 (lpstat -p). |
| printer-name | Is the 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.
-
-
Start printing print requests on the printer by using the enable command.
-
Verification--Enabling or Disabling a Printer
-
Examples--Enabling or Disabling a Printer
- 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
|
· How to Cancel a Print Request
-
-
If you are going to cancel print requests of other users, become root 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" on page 949 for more details.
-
-
Cancel a print request by using the cancel command.
-
$ cancel request-id | printer-name
|
- In this command,
-
request-id....Is the 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.
Examples--Canceling a Print Request
- 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
|
· How to Cancel a Print Request From a Specific User
-
-
If you are going to cancel print requests of other users, become root or lp.
-
Cancel a print request from a specific user with the cancel command.
-
$ cancel -u user-list [printer-name]
|
- In this command,
-
-u user-list...Cancels the print request for a specified user.
-
user-list can be one or more user names. Use a space or a comma to separate user names. If you use spaces, enclose the list of names in quotes.
-
printer-name..Specifies the printer for which you want to cancel the specified user's print requests.
-
printer-name can be one or more printer names. Use a space or a comma to separate printer names. If you use spaces, enclose the list of printer names in quotes.
- If you don't specify printer-name, the user's print requests will be canceled on all printers.
Examples--Cancelling a Print Request From a Specific User
- 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
|
· How to Move Print Requests to Another Printer
-
-
Log in as root or lp on the print server.
-
(Optional) Check the request IDs of the print requests on the original printer.
-
# lpstat -o printer-name1
|
- 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.
-
-
(Optional) Check if the destination printer is accepting print requests.
-
# lpstat -p printer-name2
|
- In this command,
-
printer-name2..Is the 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
|
- In this command,
-
| printer-name1 | Is the name of the printer from which all print requests will be moved. |
| printer-name2 | Is the 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.
-
Verification--Moving Print Requests to Another Printer
- Check for any remaining print requests in the original printer's queue by using the following command:
-
- Make sure all specified print requests were moved to the destination printer's queue by using the following command:
-
Example--Moving Print Requests to Another Printer
- 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
|
· How to Change the Priority of a Print Request
-
-
Log in as root 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" on page 949 for more information.
-
Change the priority of a print request by using the lp command.
-
# lp -i request-id -H change-priority
|
- In this command,
-
request-id......Is the 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.
-
change-priority...Is one of the three ways to change the priority of a print request: hold, resume, immediate.
- See Table 49-4 on page 949 for detailed information about valid values for change-priority.
- You can also use the -q option of the lp 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.
Example--Changing the Priority of a Print Request
- In the following example, the command changes a print request with the request ID asteroid-79, to priority level 1.
-
|
|