This section describes the resources that the SunSoft print client commands use to locate printer names and printer configuration information.
The SunSoft print client commands can use a name service, which is a network (shared) resource for storing printer configuration information for all printers on the network. The name service (NIS or NIS+) simplifies printer configuration maintenance: When you add a printer in the name service, all SunSoft print clients on the network can access it.
Figure 39-3 highlights the part of the print process in which the SunSoft print client commands check a hierarchy of printer configuration resources to determine where to send the print request.
As shown in Figure 39-4, the SunSoft print client commands use more options to locate printers and printer configuration information.
A user submits a print request from a SunSoft print client by using the lp or lpr command. The user can specify a destination printer name or class in any of three styles:
Atomic style, which is the print command and option followed by the printer name or class, as shown in this example.
% lp -d neptune filename |
POSIX style, which is the print command and option followed by server:printer, as shown in the following example.
% lpr -P galaxy:neptune filename |
Context-based style, as defined in the Federated Naming Service Guide in the Solaris 2.6 Software Developer AnswerBook, shown in this example.
% lpr -d thisdept/service/printer/printer-name filename |
The print command locates a printer and printer configuration information as follows:
It checks to see if the user specified a destination printer name or printer class in one of the three valid styles.
If the user didn't specify a printer name or class in a valid style, the command checks the user's PRINTER or LPDEST environment variable for a default printer name.
If neither environment variable for the default printer is defined, the command checks the .printers file in the user's home directory for the _default printer alias.
If the command does not find a _default printer alias in the .printers file, it then checks the SunSoft print client's /etc/printers.conf file for configuration information.
If the printer is not found in the /etc/printers.conf file, the command checks the name service (NIS or NIS+), if any.
These are the advantages of the SunSoft Print Client method to locate printers:
You can use a name service (NIS or NIS+) to store printer information in one central location. This is the single most important feature of the SunSoft Print Client software. If you want to add a printer and make it available to all SunSoft print clients on the network, all you have to do is enter the printer information in the name service. The same principle applies to modifying and deleting printers. The printer information in the name service is available to all SunSoft print clients.
Users can manipulate their .printers file to customize printer information. Even though SunSoft print clients know about the printers that are listed in the name service, you can customize the clients' printer configuration files to use printer aliases and to find only certain printers when canceling print requests or getting status information.
If you don't use a name service, you can still decrease the amount of time it takes to set up and administer printing by creating a master of the /etc/printers.conf file with all printers on the network and copying that file to SunSoft print clients. For further information about using the /etc/printers.conf file, see Chapter 41, Setting Up Printers (Tasks)
The SunSoft print client software uses POSIX-style names, which means print clients can access printers that aren't defined on the print client or in the name service.
A name service provides the most efficient way to add, modify, and delete printer configuration information for a network. Almost every site can benefit significantly from using a name service. One exception might be a very small network with only a few printers and print clients.