Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
4.  Setting Up Printers (Tasks) Adding a Network Printer Printer Vendor Supplied Software for Network Printers  Previous   Contents   Next 
   
 

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)".

 
 
 
  Previous   Contents   Next