System Administration Guide

Enabling Print Clients to Access Existing Printers

Once you create a master /etc/printers.conf file that includes the existing printers at your site, you can enable all the SunSoft print clients to access the existing printers in two ways.

How to Use the /etc/printers.conf File to Load NIS

  1. Log in as superuser on the system that contains the /etc/printers.conf file to be copied to the NIS master server.

  2. Copy the system's /etc/printers.conf file to the NIS master server's /etc directory.

  3. Copy the /usr/lib/print/Makefile.yp makefile to the NIS master server's /var/yp directory.

  4. Log in as superuser on the NIS master server.

  5. On this system, specify how to process the files.


    # make -f /var/yp/makefile -f /var/yp/Makefile.yp printers.conf
    
    -f /var/yp/makefile

    Specifies the NIS makefile. 

    -f /usr/lib/print/Makefile.yp

    Specifies the NIS print makefile. This means implicit rules and predefined macros from both makefiles are concatenated. 

    printers.conf

    Specifies the file to be created or updated. 

How to Use the /etc/printers.conf File to Load NIS+

  1. Make sure you are a member of the NIS+ admin group. You must have the appropriate privileges to perform this task.

  2. Log in as superuser on the system that contains the /etc/printers.conf file to be copied to the NIS+ master file.

  3. Copy the system's /etc/printers.conf file to the NIS+ master file.


    # fncreate_printer -f /etc/printers.conf thisorgunit/service/printer
    

    See the Federated Naming Service Guide in the Solaris 2.6 Software Developer AnswerBook if you need information about entering this command.

Where to Go From Here

After you have given SunSoft print clients access to existing printers, users may want to set up the .printers file in their home directory to contain custom printer aliases. For step-by-step instructions, see the next section.

Setting Up a .printers File

There is no need to set up a .printers file in your users' home directories if they don't need customized printer information. However, the .printers file enables users to establish their own custom printer aliases. You can use the alias _default to make a printer the default and also set up a special alias _all to define a list of printers affected when you cancel a print request or check the status of printers.

Keep in mind that the LP commands check a user's home directory to locate printer configuration information before they check the name service. This means you can tailor a user's printer configuration file to use custom printer information rather than the shared information in the name service.

See printers(4) for detailed information about the .printers file.

(Optional) How to Set Up a .printers File

  1. Log in to the user's system as root.

  2. Start the file editor you want to use to create a .printers file in the user's home directory.

  3. (Optional) Set up the _default alias to make a specific printer your default printer, using an entry similar to the one shown in the following example.


    # _default printer_name
    
  4. (Optional) Set up the _all alias to define the printers affected when you cancel a print request or check the status of printers, using an entry similar to the one shown in the next example.


    # _all printer1 printer2 printer3
    
  5. Save the file as .printers.