System Administration Guide: Advanced Administration

Chapter 4 Setting Up Printers (Tasks)

This chapter describes how to set up a printer and make it accessible to systems on the network with Solaris Print Manager.

For information on the procedures associated with setting up printers with Solaris Print Manager, see Setting Up Printing (Task Map).

For overview information about printers, see Chapter 2, Managing Printing Services (Overview).

Setting Up Printing (Task Map)

Task 

Description 

For Instructions 

1. Add New Attached Printer 

Using Solaris Print Manager – After you physically attach the printer to a system, make the printer available for printing.  

How to Add a New Attached Printer With Solaris Print Manager

2. Add Access to a Printer 

Using Solaris Print Manager – Add printer access on the print client. 

How to Add Printer Access With Solaris Print Manager

3. (Optional) Set Up a .printers File

Use a $HOME/.printers file so that users can establish their own custom printer aliases.

How to Set Up a .printers File

4. Add a New Network Printer 

Using Printer Vendor Supplied Tools – After you physically connect the printer to the network, use vendor-supplied software to configure the network printer.  

How to Add a Network Printer With Printer Vendor Supplied Tools

 

Using LP Commands – After you physically connect the printer to the network, configure the network printer.  

How to Add A Network Printer With LP Commands

5. (Optional) Turn Off Banner Pages 

You can turn off banner pages so they are never printed. 

How to Turn Off Banner Pages

6. (Optional) Set Up Fault Alerts  

You can set up more specific fault alerts for the printer than Solaris Print Manager provides.  

How to Set Fault Alerts for a Printer

7. (Optional) Set Up Fault Recovery 

You can set up how a printer should recover after it faults.

How to Set Printer Fault Recovery

8. (Optional) Limit Access to the Printer  

Solaris Print Manager enables you to set up an allow list, but if you want to limit a few users' access to the printer, you might want to set up a deny list.  

How to Limit User Access to a Printer

Setting Up Printing With Solaris Print Manager

Solaris Print Manager is a Java-based graphical user interface that enables you to manage local and remote printer configuration. This tool can be used in the following name service environments: LDAP, NIS, NIS+, NIS+ with Federated Naming Service (xfn), and files. You must be logged in as superuser to use this tool.

You can use Solaris Print Manager to set up print servers (New Attached Printer) and print clients (Add Access to Printer). A local or attached printer is one which is physically cabled to the print server. A network printer is physically attached to the network. Adding access to a printer, or adding remote access, is the process of giving print clients (all those machines which are not the server) access to the printer.

Setting Up a Printer With Solaris Print Manager

The following table describes each printer attribute to help you determine the information needed to set up a printer with Solaris Print Manager.

Printer Attribute 

Description 

Example 

Default Setting 

Required or Optional? 

Printer Name 

Name of printer 

laser1

N/A 

Required to install an attached or network printer and to add access to a printer 

Printer server 

Name of printer server 

venus

The local system 

Required to install an attached or network printer and to add access to a printer 

Description 

User defined string 

laser printer near breakroom

N/A 

Optional 

Printer Port 

Device printer is attached to 

/dev/term/a

/dev/term/a

Required to install an attached printer 

Printer Type 

Type of printer 

unknown

PostScript

Required to install an attached or network printer  

File Contents 

Content to be printed 

any

PostScript

Required to install an attached or network printer  

Destination 

Destination name for network printers 

See Selecting the Destination (or Network Printer Access) Name for examples

N/A 

Required to install a network printer  

Protocol 

Protocol used to communicate with printer 

TCP

BSD

Required to install a network printer  

Fault Notification 

How to notify user of errors 

Mail to superuser

Write to superuser

Optional 

Default Printer 

Identifies the default printer 

N/A 

N/A 

Optional 

Always Print Banner 

Print banner with print job? 

N/A 

Banner is printed 

Optional 

User Access List 

List of users allowed to print 

rimmer,lister

All users can print 

Optional 

Solaris Print Manager and Special Characters

Solaris Print Manager checks user input for the various text fields in the input screens. There are two types of checking: general illegal input and input that is illegal for specific fields.

Solaris Print Manager does not accept the following characters as input, except for the help screens:

Starting Solaris Print Manager

To use Solaris Print Manager to set up your printers, start Solaris Print Manager either by selecting Printer Administrator from the CDE Workspace menu or by starting it from the command line. See the following section for details.

How to Start Solaris Print Manager

  1. Verify that the following prerequisites are met. To use Solaris Print Manager, you must:

    • Have a bit-mapped display monitor. Solaris Print Manager can be used only on a system with a console that is a bit-mapped screen, such as a standard display monitor that comes with a Sun workstation.

    • Be running an X Window System, such as the CDE environment, or be using the remote display feature on a system running an xhost environment.

    • Be logged in as superuser on the printer server to install an attached or network printer, or on the print client to add access to a printer.

    • Have the required access privileges for managing the LDAP, NIS, NIS+, or NIS+ (xfn) database:

      • If your name service is LDAP, you must have the following:

        • The distinguished name (DN) of a printer administrator and password in the directory.

        • The name or IP address of an LDAP server hosting the administered domain. This is usually displayed and selected automatically.

          For more information about using LDAP to manage printer information, see Managing Printer Information With LDAP.

      • If your name service is NIS, you must have the root password for the NIS master.

      • If you name service is NIS+, you might need to do the following:

        1. Log in to the NIS+ master as superuser.

        2. Identify the group that owns the printers table:


          # niscat -o printers.org_dir.domain_name.com
                      .
                      .
                      .
                   Group		: "admin.domain_name.com"
        3. If necessary, add the system that runs Solaris Print Manager to the NIS+ admin group authorized to update the printers.org_dir.<domain> file.


          # nisgrpadm -a admin.domain_name.com host_name
          
        4. Log in to the system that runs Solaris Print Manager as superuser. Depending on your NIS+ configuration, you might also need to run the /usr/bin/keylogin command. For more information, see keylogin(1).

      • If your name service is NIS+ (xfn), you might need to do the following:

        1. Log in to the NIS+ master as superuser.

        2. Identify the group that owns the federated naming table:


          # niscat -o fns.ctx_dir.domain_name.com
                      .
                      .
                      .
                   Group		: "admin.domain_name.com"
        3. If necessary, add the system that runs Solaris Print Manager to the NIS+ admin group authorized to update the fns.ctx_dir.<domain> file.


          # nisgrpadm -a admin.domain_name.com host_name
          
        4. Log in to the system that runs Solaris Print Manager as superuser. Depending on your NIS+ configuration, you might also need to run the /usr/bin/keylogin command. See keylogin(1) for more information.

    • Have the SUNWppm package installed.


      # pkginfo | grep SUNWppm
      system      SUNWppm        Solaris Print Manager
  2. Start Solaris Print Manager by one of the following methods:

    • Select Printer Administrator from the Tools option of the CDE Workspace menu.

    • Select the Applications menu from the CDE front panel, and click the Printer Administrator icon in the Application Manager's System_Admin window

    • From the command line:


      # /usr/sadm/admin/bin/printmgr &        
      

    The Select Naming Service window overlays the Solaris Print Manager main window.

    If you want to use Solaris Print Manager from a remote system, do the following:

    Use the xhost command on the local system to give the remote system display access, like this:


    # xhost +remote-system
    

    Then log in to the remote system, set the DISPLAY environment variable, and start Solaris Print Manager:


    # DISPLAY=local-system:display_number
    # export DISPLAY
    # /usr/sadm/admin/bin/printmgr &
    

    Note –

    If Solaris Print Manager fails to start from the CDE menu or from the command line, check the following:

    1. Superuser (root) might not have permission to connect to the X-server process on the local or remote system. If this happens, type the following:


      $ xhost +hostname
      $ su
      (Enter root's password)
      # /usr/sadm/admin/bin/printmgr &
      

      Replace hostname with either the local or remote system name before restarting Solaris Print Manager.

    2. Verify that the SUNWppm package is installed on the local or remote system.


      $ pkginfo | grep SUNWppm
      

  3. Select the name service used in your network from the Select Naming Service window. Choices are: NIS+ (xfn), NIS+, NIS, or files.

  4. Check that the domain name is correct.

    The Solaris Print Manager main menu is displayed after the name service is loaded successfully.

Setting Up a Print Server

When you install an attached printer and/or a network printer to a system, the printer is made accessible to the local system. The system on which you install the printer becomes the print server.

The following sections describe how to use Solaris Print Manager to add an attached printer or a network printer on a printer server. The example that follows each Solaris Print Manager procedure describes how to add a printer with LP commands.

How to Add a New Attached Printer With Solaris Print Manager

  1. Select the system to be the print server.

  2. Connect the printer to the print server and turn on the power to the printer.

    Consult the printer vendor's installation documentation for information about the hardware switches and cabling requirements.

  3. Start Solaris Print Manager on the print server where you connected the printer.

    For instructions, see How to Start Solaris Print Manager.

  4. Select New Attached Printer from the Printer menu.

    The New Attached Printer window is displayed.

  5. Fill in the window.

    If you need information to complete a field, click the Help button.

  6. Click OK.

  7. Verify that the printer has been installed by checking for the new printer entry in the Solaris Print Manager main window.

  8. Verify that the printer can print requests.


    $ lp -d printer-name filename
    
  9. Exit Solaris Print Manager.

    Choose Exit from the Print Manager Menu.

Example—Adding a New Attached Printer With LP Commands

This example shows how to make a local PostScript printer available for printing on a print server. The commands in this example must be executed on the print server where the printer is connected. The following information is used as an example. The information you provide will vary:

  1. Gives lp ownership and sole access to a port device.

  2. Defines the printer name and the port device the printer will use.

  3. Sets the printer type of the printer.

  4. Specifies the file content types to which the printer can print directly.

  5. Adds print filters to the print server.

  6. Accepts print requests for the printer and enables the printer.

  7. Adds a description for the printer.

  8. Verifies that the printer is ready.

Where to Go From Here

Use the following table to determine which tasks to complete next.

Task 

For More Information 

Add access to the newly installed printer on the print clients because you did not add the printer information to the name service database. 

How to Add Printer Access With Solaris Print Manager

Set up a .printers file.

How to Set Up a .printers File

Setting Up a Print Client

A print client is a system that is not the server for the printer, yet has access to the printer. A print client uses the services of the print server to spool, schedule, and filter the print jobs. Note that one system can be a print server for one printer and be a print client for another printer.

Access to a printer can be configured on a domain-wide basis or on a per-machine basis depending on whether you add the printer information to the name service database.

The following sections describe how to use the new Solaris Print Manager to add access to a printer on a print client. The example that follows this procedure describes how to add printer access with LP commands.

How to Add Printer Access With Solaris Print Manager

  1. Start Solaris Print Manager on the system where you want to add access to a remote printer.

    For instructions, see How to Start Solaris Print Manager.

  2. Select Add Access to Printer from the Printer menu.

    The Add Access to Printer window is displayed.

  3. Fill in the window.

    If you need information to complete a field, click the Help button.

  4. Click OK.

  5. Verify that access to the printer is added by checking for the new printer entry in the Solaris Print Manager main window.

  6. Verify that the printer can print requests.


    $ lp -d printer-name filename
    
  7. Exit Solaris Print Manager.

    Choose Exit from the Print Manager Menu.

Example—Adding Printer Access With LP Commands

If you want to print to a remote printer, you must add access to the remote printer. This example shows how to configure access to a printer named luna, whose print server is saturn. The system saturn becomes a print client of the printer luna.


# lpadmin -p luna -s saturn 1
# lpadmin -p luna -D "Room 1954 ps" 2
# lpadmin -d luna 3
# lpstat -p luna 4
  1. Identifies the printer and the print server.

  2. Adds a description for the printer.

  3. Sets the printer as the system's default printer destination.

  4. Verifies that the printer is ready.

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 printer aliases. You can use the _default alias to make a printer the default. You can also set up a special _all alias to define a list of printers affected when you cancel a print request or check the status of printers.

Keep in mind that the use of the .printers file by the LP print service is controlled by the name service switch (/etc/nsswitch.conf). The default configuration is that the print service checks a user's home directory to locate printer configuration information before its checks the other name services. 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.

For more information about the .printers file, see printers(4). For more information about the name service switch, see nsswitch.conf(4).

How to Set Up a .printers File

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

  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.

Adding a Network Printer

A network printer is a hardware device this is directly connect to the network. This means it can be accessed from a print server without actually connecting it the print server with a cable. It has its own system name and IP address. Even though a network printer is not connected to a print server, it is necessary to set up a print server for it. The print server provides queuing capabilities, filtering, and printing administration for the network printer.

Network printers might use one or more special protocols that require a vendor-supplied printing program. The procedures to set up the vendor-supplied printing program can vary. If the printer does not come with vendor supplied support, the Solaris network printer support can be used with most devices. Use the print vendor supplied software when possible.

The vendor might supply an SVR4 printer interface script to replace the standard printer interface script. If so, their SVR4 interface script will call the vendor-supplied printing program to send the job to the printer. If not, you will need to modify the standard interface script to call the vendor-supplied printing program. You can do this by editing the per-printer copy of the standard interface script to call the vendor-supplied printing program.

The terms used in network printer configuration are:

Printer Vendor Supplied Software for Network Printers

Network printers often have software support provided by the printer vendor. If your printer has printer vendor supplied software, use the printer vendor software when possible. The software is designed to support the attributes of the printer and can take full advantage of the printer capabilities. Read the printer vendor documentation to install and configure the printer under an LP print system.

Sun Support for Network Printers

If the network printer vendor does not provide software support, the Sun supplied software is available. The software provides generic support for network printers and is not capable of providing full access to all possible printer attributes.

A general discussion of how to add a network printer is provided in Chapter 4, Setting Up Printers (Tasks). The following is a discussion of printer management using the Sun supplied software.

Invoking the Network Printer Support

The software support for network printers is called through the interface script. Configuring a network printer with the network interface script, netstandard, causes the network printer support module to be called. The command to configure the printer with the network support is as follows:


lpadmin -p printer_name -m netstandard 

Selecting the Protocol

The print subsystem uses BSD print protocol and raw TCP to communicate with the printer. The printer vendor documentation provides the information about which protocol to use. In general, we have found that the TCP protocol is more generic across printers.

The command to select the protocol is:


lpadmin -p printer_name -o protocol=bsd

or


lpadmin -p printer_name -o protocol=tcp

If the protocol selected is the BSD print protocol, you can further select the order of sending the control file to the printer. Some printers expect the control file, then the data file; others the reverse. For this information, see the printer vendor documentation. The default is to send the control file first.

The command to select the ordering is:


lpadmin -p printer_name -o bsdctrl=first

or


lpadmin -p printer_name -o bsdctrl=last

Selecting the Printer Node Name

The system administrator selects the printer node name. This name must be unique, as with any node on the network. The printer node name is associated with the IP address of the printer.

Selecting the Destination (or Network Printer Access) Name

The print subsystem requires access information for the printer. This is the name that the subsystem uses when making the network connection to the printer. This name is supplied by the system administrator to the print subsystem by using the lpadmin command. It becomes part of the printer configuration database. The printer access name is the name of the printer node, sometimes qualified by a port name. Port designation varies across printer vendors. You will find information about port designation in the documentation that is provided with the printer by the printer vendor. The format of printer access name is:

printer_node-name[:port_designation]

Example 1—Destination (or Network Printer Access Name) With Port Designation (Number)

A common port designation with TCP is 9100. If the printer node name is pn1, and the printer vendor defines the port as 9100, then the printer access name is: pn1:9100. To configure a printer in this case use:


lpadmin -p printer_name -o dest=pn1:9100

Example 2—Destination (or Network Printer Access Name) With Port Designation (Name)

When using the BSD protocol, the port designation might not be a number, but some name defined by the printer vendor, for example: xxx_parallel_1. If the printer node name is cardboard, then the printer access name is: cardboard:xxx_parallel_1. To configure a printer in this case use:


lpadmin -p printer_name -o dest=cardboard:xxx_parallel_1

Example 3—Destination (or Network Printer Access Name) With No Port Designation

If there is no port designation, and the printer node name is newspaper, the printer access name is the printer node name: newspaper. To configure a printer in this case use:


lpadmin -p printer_name -o dest=newspaper

Setting the Timeout Value

The timeout option is provided to allow for individual selection of the amount of time (in seconds) to wait between successive attempts to connect to the printer. Some printers have a long warm up time and a longer timeout value is advised. The default is 10 seconds.

The timeout value does not impact the success or failure of the print process. It is a seed value which the software uses as the initial timeout count. On repeated failures, this count is increased. A message is sent to the spooler when repeated attempts to connect to the printer fail. This alerts the user that intervention might be required. This could be anything from the printer being turned off, to out of paper. Should these messages be produced too often, for example when the printer is warming up, increasing the timeout value will eliminate spurious messages.

The system administrator can experiment to find the optimal timeout value. The command to set the timeout is:


lpadmin -p printer_name -o timeout=n

Managing Network Printer Access

Each network printer should have one and only one server that provides access to it. This enables the server to manage the access to the printer and keep jobs coherent.

The default device for the network printer is /dev/null. This is sufficient when there is only one queue for the printer. Should more queues be required, set the device to a file. This enables the print system to restrict access to the printer across queues. The following commands create a device file and configure it as the network printer device.


touch /path/filename
chmod 600 /path/filename
lpadmin -p printer_name -v /path/filename

The following is an example of how to create a device file called devtreedown.


# touch /var/tmp/devtreedown
# chmod 600 /var/tmp/devtreedown
# lpadmin -p treedown -v /var/tmp/devtreedown

How to Add a Network Printer With Printer Vendor Supplied Tools

  1. Connect the printer to the network and turn on the power to the printer.

    Consult the printer vendor's installation documentation for information about the hardware switches and cabling requirements. Get an IP address and select a name for the printer node. This is equivalent to adding any node to the network.

  2. Follow the printer vendor instructions to add the network printer.

    Use the printer vendor instructions to configure the network printer. These will be specific to the vendor and printer.

  3. Add client access to the new printer.

    Now that the printer has been added, create access to the printer for the clients. For more information, see Setting Up a Print Client.

  4. Optional tasks to complete.

    There are several optional tasks you might want to complete when setting up a network printer. For pointers to the remaining tasks, see Setting Up Printing (Task Map).

How to Add A Network Printer With LP Commands

This procedure describes the steps necessary to setup a network printer using the network printer support software. The use of this software is intended for those printers that do not come with vendor supplied software.

  1. Connect the printer to the network and turn on the power to the printer.

    Consult the printer vendor's installation documentation for information about the hardware switches and cabling requirements. Get an IP address and select a name for the printer node. This is equivalent to adding any node to the network.

  2. Collect the information required to configure a network printer.

    • Printer name

    • Printer server

    • Network printer access name

    • Protocol

    • Timeout

    For more information, see the terms described in Adding a Network Printer.

  3. Define the printer name, the device, the printer type and content type.

    1. Define the printer name and the port device the printer will use.


      # lpadmin -p printer-name -v /dev/null
      

      The device to use is /dev/null.

    2. Identify the interface script the printer will use.


      # lpadmin -p printer-name -m netstandard 
      

      The interface script that is supplied with the network printer support software is /usr/lib/lp/model/netstandard.

    3. Set the printer destination, protocol, and timeout values.


      # lpadmin -p printer-name -o dest=access-name:port -o protocol=protocol
      -o timeout=value
      

      -p printer-name

      Specifies the network printer name. 

      -o dest=access-name:port

      Sets the printer destination to the network printer access name and a designated printer vendor port, if it is defined in the printer vendor documentation. 

      -o protocol=protocol

      Sets the over-the-wire protocol used to communicate with the printer. Both BSD and raw TCP are supported. 

      -o timeout=value

      Sets a retry timeout value that represents a number of seconds to wait between attempting connections to the printer.  

    4. Specify the file content types of the printer and the printer type.


      # lpadmin -p printer-name -I content-type -T printer-type
      

      For more information, see lpadmin(1M).

  4. Add filters to the print server.


    # cd /etc/lp/fd
    # for filter in *.fd;do
        > name=`basename $filter .fd`
        > lpfilter -f $name -F $filter
        > done
    
  5. Enable the printer to accept printer requests and to print the requests.


    # accept printer-name
    # enable printer-name
    
  6. Verify that the printer is correctly configured.


    # lpstat -p printer-name
    
  7. Add client access to the new printer.

    Now that the printer has been added, create access to the printer for the clients. For more information, see Setting Up a Print Client.

  8. Optional tasks to complete.

    There are several optional tasks you might want to complete when setting up a printer. For pointers to the remaining tasks, see Setting Up Printing (Task Map).

Example—Adding A Network Printer With LP Commands

The commands in this example must be executed on the print server. The following information is used as an example. The information you provide will vary.

  1. Defines printer name and sets the device to /dev/null.

  2. Defines the interface script for network printers.

  3. Sets the destination, protocol, and timeout.

  4. Specifies the file content types to which the printer can print directly, and the printer type.

  5. Adds print filters to the print server.

  6. Accepts print requests for the printer and enables the printer.

  7. Adds a description for the printer.

  8. Verifies that the printer is ready.

Converting Printer Configuration Information

This section explains how to convert the printer configuration information from systems running the SunOS 5.5.1 release and copy this information to print clients so they can access existing printers.


Note –

If you have only a few existing printers, it might be easier to add access to the printers by using Solaris Print Manager rather than convert the printer configuration information and distribute it to print clients. For information on adding access to printers, see Setting Up Printing (Task Map).


Converting Printer Configuration Information (Task Map)

The following task map identifies the tasks associated with converting printer configuration information.

Task 

Description 

For Instructions 

Convert Existing Printer Configuration Information 

Convert Printer Configuration Information for Systems Running the SunOS 5.5.1 Release – If your site uses the SunOS 5.5.1 release, you can convert the printer configuration information in the /etc/lp/printers directory to the /etc/printers.conf configuration file. This is usually a one-time task.

How to Convert Printer Information For a System Running the Solaris 2.5.1 Release

 

Convert Printer Configuration Information for a System Running an lpd-based Print Server – If your site uses lpd-based software, you convert the printer configuration information in the /etc/printcap file to the /etc/printers.conf configuration file. This is usually a one-time task.

How to Convert Printer Information For a System Running an lpd-based Print Server

Converting Existing Printer Configuration Information

Existing printer configuration information is automatically converted when installing or upgrading to the Solaris 9 release. This section explains how to convert the printer configuration information for a system running SunOS 5.5.1 release or a system running a lpd-based printer server to the /etc/printers.conf printer configuration file. You'll use one of two print administration commands to automate the conversion task:

If you are not using a name service, you should create a master /etc/printers.conf file that includes the existing printers at your site. You can then copy the master file to all the print clients or by loading it into the NIS or NIS+ name service. This is a good way to initially enable all the new print clients access to the existing printers at your site.


Caution – Caution –

If you are using the NIS or NIS+ name service to configure printer information, do not use a /etc/printers.conf file on your print clients. A print client uses the /etc/printers.conf file first to locate a printer; however, the /etc/printers.conf file might conflict with the printer information in the NIS or NIS+ maps and cause unexpected results. To avoid this problem, remove the /etc/printers.conf file on print clients when you want them to use NIS or NIS+ for printer information.


How to Convert Printer Information For a System Running the Solaris 2.5.1 Release

  1. Log in as superuser on the system running the Solaris 9 release.

  2. Convert the printer configuration information in the system's /etc/lp/printers directory to the /etc/printers.conf file.


    # /usr/lib/print/conv_lp
    

How to Convert Printer Information For a System Running an lpd-based Print Server

  1. Copy the /etc/printcap file from a system running an lpd-based print server to a system running the Solaris 9 release.

  2. Log in as superuser on the system running the Solaris 9 release where you copied the /etc/printcap file.

  3. Convert the printer configuration information in the /etc/printcap file to the /etc/printers.conf file.


    # /usr/lib/print/conv_lpd