Example--Deleting a Printer and Remote Printer Access
The following example shows how to 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". terra# lpstat -p luna -l jupiter# lpadmin -x luna jupiter# lpsystem -r terra Removed "terra". jupiter# lpstat -p luna -l |
Checking Printer Status
Many routine printer administration tasks require information about the status of the LP print service or a specific printer. For example, you can determine which printers are available for use and examine the characteristics of those printers. You can use the lpstat command to find out status information about the LP print service or a specific printer.
How to Check the Status of Printers
Log in to any system on the network.
Check the status of printers.
Only the most commonly used options are shown here. For other options, see lpstat(1).
$ lpstat [-d] [-p printer-name [-D] [-l]] [-t]
-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
The following example shows how to displays the system's default printer.
$ lpstat -d system default destination: luna |
The following example shows how to display the status of the printer luna.
$ lpstat -p luna printer luna is idle. enabled since Jul 12 11:17 2001. available. |
The following example shows how to display the description of the printers asteroid and luna.
$ lpstat -p "asteroid luna" -D printer asteroid faulted. enabled since Jul 12 11:35 2001. available. unable to print: paper misfeed jam Description: Printer by break room printer luna is idle. enabled since Jul 12 11:36 2001. available. Description: Printer by server room. |
The following example shows how to display the characteristics of the printer luna.
$ lpstat -p luna -l printer luna is idle. enabled since Thu Jul 12 15:02:32 ... Form mounted: Content types: postscript Printer types: PS Description: Connection: direct Interface: /usr/lib/lp/model/standard After fault: continue Users allowed: (all) Forms allowed: (none) Banner not required Character sets: Default pitch: Default page size: 80 wide 66 long Default port settings: |
Restarting the Print Scheduler
The print scheduler, lpsched, handles print requests on print servers. However, there might be times when the print scheduler stops running on a system, so print requests stop being accepted or printed.
The following section describes how to restart the print scheduler. If a print request was printing when the print scheduler stopped running, the print request will be printed in its entirety when you restart the print scheduler.
How to Stop the Print Scheduler
Log in as superuser, lp, or assume an equivalent role on the print server.
Check to see if the print scheduler is running.
# lpstat -r
If the print scheduler is not running, the message scheduler is not running is displayed.
If the print scheduler is running, stop it.
# /etc/init.d/lp stop
How to Restart the Print Scheduler
Log in as superuser, lp, or assume an equivalent role on the print server.
Check to see if the print scheduler is running.
# lpstat -r
If the print scheduler is not running, the message scheduler is not running is displayed.
If the print scheduler is not running, start it.
# /etc/init.d/lp start
Setting or Resetting Miscellaneous Printer Definitions
This section provides step-by-step instructions on setting or resetting printer definitions. Some of the following printer definitions can be set using Solaris Print Manager. The following procedures use the LP commands to quickly set or reset printer definitions.
How to Add a Printer Description
Log in as superuser, lp, or assume an equivalent role on the print server.
# lpadmin -p printer-name -D "comment"
-p printer-name
Name of the printer for which you are adding a description.
-D "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.
For more information, see lpadmin(1M).
The printer description is added in the print server's /etc/lp/printers/printer-name/comment file.
Verify that the Description information is correct.
$ lpstat -p printer-name -l