System Administration Guide, Volume II
この本のみを検索
PDF 文書ファイルをダウンロードする

Setting Up Printers

48

This chapter explains how to set up a printer and make it accessible to systems on the network. You can perform most printer setup tasks by using Admintool; however, you can add a network printer only from the command line.
This is a list of the step-by-step instructions in this chapter.
How to Start Admintoolpage 915
How to Add a Local Printerpage 917
How to Add Access to a Remote Printerpage 919
How to Add a Network Printerpage 921
For overview information about printers, see Chapter 47, "Overview of Print Management."

Note - The SunSoft print client software and the Printer Manager application in Solstice AdminSuite offer the best solution for setting up and managing printers on a network. The advantage of the SunSoft print client software is that it supports a name service (NIS or NIS+), which enables you to centralize print administration for a network.
You can also set up a printer by using the LP print service commands instead of Admintool, although the manual process is more complicated. See "Setting Up a Printer With the LP Print Service Commands" on page 923 for detailed examples.

Setting Up Printing

Table 48-1 provides an overview of the tasks necessary to set up local and network printers and print clients.
Table 48-1 Task Map: Setting Up Printing
Activity........Description
For Examples, Go To
Local Printer

After physically attaching the printer to a system, you must use Admintool to make the printer available for printing. The system to which the printer is connected becomes a print server.

· How to Add a Local Printerpage 917
Network Printer

After physically connecting the printer to the network, you must add a vendor-supplied SVR4 printer interface program or printing program to a system that becomes a print server for the printer.

· How to Add a Network Printerpage 921
Add a Printer
· How to Set Printer Optional. Admintool does not enable you to set up how Fault Recovery a printer should recover after it faults. By default, a
printer tries to continue printing at the top of the page
where printing stopped.
page 944
Set Up Fault Recovery
Optional. You can set up more specific fault alerts for the printer than Admintool provides.· How to Set Fault Alerts for a Printerpage 945
Set Up Fault Alerts
Optional. You can turn off banner pages so a banner page is never printed on the printer. Admintool only enables you to make banner pages optional.· How to Turn Off Banner Pagespage 942
Turn Off Banner
Pages
Optional. Admintool enables you to set up an allow list, but if you want to limit a few users' access to the printer, you may want to set up a deny list.· How to Limit User Access to a Printerpage 947
Limit Access to the
Printer
Activity........Description
For Instructions, Go To
You must individually configure each system on the network to access the new printer. The systems become print clients for that printer.· How to Add Access to a Remote Printerpage 919
Add Access to the
Printer

· How to Start Admintool

  1. Verify that the following prerequisites are met. To use the Admintool software, you must have:

  • A bit-mapped display monitor. The Admintool software 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.
  • OpenWindows software. Start this software with the following command:

  $ /usr/openwin/bin/openwin  

  • Membership in the sysadmin group (group 14).
  1. Log in on the system where you want to set up the printer.

  2. Start Admintool with the following command:


  $ admintool &  

The Admintool main window is displayed.
  1. Select Printers from the Browse menu.

    The Printers window is displayed.

Setting Up a Print Server

When you add a local printer to a system through Admintool, the printer is made accessible to the local system. The system on which you install the printer becomes the print server.

· How to Add a Local Printer

  1. Connect the printer to a system and turn on the power to the printer.

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

  2. Start Admintool on the system where you connected the printer.

    See the procedure on page 915 for detailed information.

  3. Select Add Local Printer from the Edit menu.

    The Add Local Printer window is displayed.

  4. Fill in the window.

    If you need information to complete a field, click on the Help button to see field definitions for this window.

  5. Click on OK.

    The printer is displayed in the Admintool Printers window. The printer is entered in the /etc/lp/printers directory of the print server.

Example--Completed Add Local Printer Window

In the following example, the printer gambit is added on the print server rogue.

Internal bitmap(348x422)

Setting Up a Print Client

When you give a system access to a remote printer through Admintool(TM), it makes that system a print client. A remote printer is any printer that is installed on a print server.

· How to Add Access to a Remote Printer

  1. Start Admintool on the system where you want to add access to a remote printer.

    See the procedure on page 915 for detailed information.

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

    The Add Access to Remote Printer window is displayed.

  3. Fill in the window.

    If you need information to complete a field, click on the Help button to see field definitions for this window.

  4. Click on OK.

    The printer is displayed in the Admintool Printers window. The printer is entered in the client's /etc/lp/printers directory.

Example--Completed Add Access To Printer Window

In the following example, the print client rogue is given access to the printer luna on the print server saturn.

Internal bitmap(348x242)

Adding a Network Printer

A network printer is a hardware device that provides printing services to print clients without being connected to a print server. It has its own system name and IP address, and is connected directly to the network. Even though a network printer is not connected to a print server, it is a good idea to set up a print server for it. A print server provides queuing capabilities and printing administration for the network printer.
Network printers provide one or more special protocols that require a vendor-supplied printing program. The procedures to set up the vendor-supplied printing program can vary.
The vendor might supply an SVR4 printer interface script to replace the standard printer interface script. If so, the 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.

· How to Add a Network Printer

  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.

  2. Follow the printer vendor instructions to add the network printer to a SunOS 5.x system that has an SVR4 LP print spooler.

    If you are adding a network printer to a system that is not set up as a print server, see "Setting Up a Printer With the LP Print Service Commands" on page 923 in addition to the vendor instructions.

  3. See the following table to find your next step in this procedure.

    Your next step depends on whether the network printer has an SVR4 printer interface script.

If the Printer ...Then ...
Has an SVR4 interface scriptGo to Step 4.
Does not have an SVR4 interface scriptGo to Step 6.
  1. Set up the printer server to use the SVR4 printer interface script to call the vendor-supplied printing program.


  # lpadmin -p printer-name -i vendor-interface  

In this command,
printer-nameIs the name of the network printer.
vendor-interfaceIs the name of the vendor-supplied SVR4 interface script for the network printer.
  1. Go to "Where to Go From Here" on page 923.

    Step 6 applies only when the printer has no vendor-supplied SVR4 interface script.

  2. Change the FILTER variable in the standard interface script, /etc/lp/interfaces/printer-name, to include the name of the vendor-supplied printing program instead of the standard printing program. If your printer type is PS (PostScript), change the following FILTER variable.


  FILTER="/usr/lib/lp/postscript/postio"  

If your printer type is PSR (Reverse PostScript), change the following FILTER variable.

  FILTER="/usr/lib/lp/postscript/postreverse | \  
       /usr/lib/lp/postscript/postio"  

If the printer is non-PostScript, change the following FILTER variable.

  FILTER="${LPCAT} 0"  

The standard interface script will use the value of the FILTER variable in the following line as the program to run to send print jobs to the device.
0<${file} eval ${FILTER} 2>&1 1>&3

The vendor-supplied printing program can be placed in the /etc/lp/interfaces directory, and it can be called from the standard interface script using that path name.

Verification--Adding a Network Printer

Submit a print request to the network printer from any system on the network and check for output.

Where to Go From Here

There are several optional tasks you may want to complete when setting up a network printer. See "Task Map: Setting Up Printing" on page 914 for pointers to the remaining tasks.

Setting Up a Printer With the LP Print Service Commands

Setting up a printer using the LP print service commands is complicated and error-prone. Admintool offers an easier and more reliable solution. Through Admintool, you just supply the information and let the tool run the required commands.
This section does not include detailed procedures on how to set up a printer using the LP print service commands, but it does provide annotated examples. The examples show the sequence of commands needed to set up a printer. You should use the examples in this chapter only when you have special needs that require the command-line approach--for example, when you need to write scripts to perform batch setup.
Regardless of the method, the decisions you make and information you need to supply during printer setup are similar, whether you use Admintool or the LP print service commands. Consequently, most of the conceptual and reference information you may need is described in "Administering Character Sets, Filters, Forms, and Fonts" on page 888 and "The Structure of the LP Print Service" on page 889.
Table 48-2 shows the high-level steps to set up a printer with the LP print service commands.
Table 48-2 Steps Required to Set Up a Printer by Using Commands
Activity........Description
For Annotated Examples, Go To
For a system to manage one or more printers, you must initialize the system as a print server. This includes configuring a systems's port monitor and registering the network listening service.· Example--Initializing a Print Serverpage 925
Initialize System as
Print Server
After you physically connect a local printer to the print
server, you need to make the printer available for
printing.
· Example--Adding a
Local Printer
page 927
Add a Local Printer
You must individually configure each system on the network to access the new printer. The systems become print clients for that printer.· Example--Adding Access to a Remote Printerpage 928
Add Access to the
Printer

Example--Initializing a Print Server

Initializing a system as a print server includes:
  • Configuring the port monitor.
  • Registering the network listen service.
This example shows how to use the sacadm and pmadm commands to initialize a print server.

  (1) # sacadm -a -p tcp -t listen -c "/usr/lib/saf/listen tcp" -v 'nlsadmin -V' -n 999  
  (2) # pmadm -a -p tcp -s lp -i root -m 'nlsadmin -o \  
       > /var/spool/lp/fifos/listenS5' -v 'nlsadmin -V`  
       # u_addr='lpsystem -A'  
  (3) # pmadm -a -p tcp -s lpd -i root -m 'nlsadmin -o /var/spool/lp/fifos/listenBSD -A \  
       > "\\x${u_addr}"` -v 'nlsadmin -V'  
       # new_addr='lpsystem -A | cut -b1-4'  
       # tail='lpsystem -A | awk '{pos = index($0, "0203")+4  
       > print substr($0, pos, length($0)-pos+1)}''  
       # new_addr='echo ${new_addr}0ACE${tail}'  
  (4) # pmadm -a -p tcp -s 0 -i root -m 'nlsadmin -c /usr/lib/saf/nlps_server -A \  
       > "\\x${new_addr}"` -v 'nlsadmin -V'  
  (5) # cat /var/saf/tcp/log  
       10/28/91 10:22:51; 178; @(#)listen:listen.c     1.19.9.1  
       10/28/91 10:22:51; 178; Listener port monitor tag: tcp  
       10/28/91 10:22:51; 178; Starting state: ENABLED  
       10/28/91 10:22:51; 178; Service 0: fd 6 addr \ \x00020ACE000000000000000000000000  
       10/28/91 10:22:51; 178; Service lpd: fd 7 addr \x00020203000000000000000000000000  
       10/28/91 10:22:52; 178; Net opened, 2 addresses bound, 56 fds free  
       10/28/91 10:22:52; 178; Initialization Complete  

(1)

Configures the port monitor to accept service requests.

(2)Registers the network System V listen service.

(3)Registers the network BSD listen service. (4)Registers the network Service 0 listen service. (5)Checks to make sure that the print services are enabled and initialized.

Configuring the Port Monitor

For print clients to access a print server, the port monitor on the print server must accept service requests and notify the LP print service of such requests. In addition, the port monitor on print clients must be running to receive messages from the server. See Chapter 56, "Setting Up Terminals and Modems With the Service Access Facility," for a complete discussion of port monitors and the Service Access Facility.

Registering the Network Listen Service With the Port Monitor

The LP print service uses a connection-oriented protocol to establish connections for incoming requests from remote systems. When the port monitor is configured, the following listen services are registered:
  • listenBSD
  • listenS5
  • Service 0
These services "listen" for print requests from print clients or confirmations from the server. When a communication is detected, the service hands over the process to the lpNet daemon.
To configure the network listen process to listen for print requests from other systems, you must register the universal address of the print server with the LP print service. The universal address is the Internet Protocol (IP) address in hexadecimal form.
You can obtain the universal address by using the lpsystem -A command. The universal address has four parts, as shown in Figure 48-1. The third part, the IP address, consists of zeros. The zeros represent a special IP address that refers to the local host. The last part, RFU, means Reserved for Future Use, and could be used for other families of addresses (for example, Open Systems Interface) in the future.

グラフィック

Figure 48-1

Example--Adding a Local Printer

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 in the example and may change depending on your situation:
  • Printer name: luna
  • Port device: /dev/term/b
  • Printer type: PS
  • File content types: postscript,simple

  (1) # chown lp /dev/term/b  
      # chmod 600 /dev/term/b  
  (2) # lpadmin -p luna -v /dev/term/b  
  (3)  
      # lpadmin -p luna -T PS (4) # lpadmin -p luna -I postscript,simple  
      # cd /etc/lp/fd (5) # for filter in *.fd;do  
      > name='basename $filter .fd'  
      > lpfilter -f $name -F $filter  
      > done  
      # lpfilter -f postio -F postio.fd  
      # lpfilter -f postior -F postior.fd  
      # lpfilter -f postprint -F postprint.fd  
      # lpfilter -f postreverse -F postreverse.fd (6) # accept luna  
      destination "luna" now accepting requests  
      # enable luna  
      printer "luna" now enabled (7)  
      # lpadmin -p luna -D "PostScript Laser printer in Building 5, Room 262" (8)  
      # lpadmin -d luna (9) # lpstat -t  
      scheduler is running  
      system default destination: luna  
      device for luna: /dev/term/b  
      luna accepting requests since Mon Mar  4 14:37:55 PST 1995  
      printer luna is idle. enabled since Mon Mar  4 14:37:59 PST 1995. available.  

(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)

Specifies this printer as the system's default printer destination.

(9)

Verifies that the printer is ready.

Example--Adding Access to a Remote Printer

If a system needs to print to a remote printer, you must add access to the remote printer. This example shows how to configure a SunOS 5.x system to access a printer named luna, which is connected to the SunOS 5.x print server terra. The system becomes a print client of the printer luna.

  (1) # lpsystem -t bsd terra  
      "terra" has been added.  
  (2) # lpadmin -p luna -s terra -T unknown -I any  
  (3) # accept luna  
      destination "luna" now accepting requests  
      # enable luna  
      printer "luna" now enabled (4)  
      # lpadmin -p luna -D "PostScript Laser printer in Building 5, Room 262" (5)  
      # lpadmin -d luna (6) # lpstat -t  
      scheduler is running  
      system default destination: luna  
      system for luna: terra  
      luna accepting requests since Mon Mar  4 15:15:21 PST 1995  
      printer luna is idle. enabled since Mon Mar  4 15:15:26 PST 1995. available.  

(1)

Identifies the print server system and its type (bsd for BSD or s5 for System V).

(2)Identifies the printer on the printer server.

(3)Specifies that the print client can send print requests to the printer. (4)Adds a description for the printer.

(5)

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

(6)

Verifies that the printer is ready.