Previous Page
Next Page

Setting Up a Network Printer

You use the vendor's software to configure the operating system of a network printer. After you have completed the vendor software installation, you don't need additional configuration. You must obtain this vendor software from the printer manufacturer and then install the printer on your system. Most network printers are easy to configure. The HP JetDirect print server is the most popular, but it is by no means the only print server available.

The first step in setting up the printer software is to connect the print server to the network and set its IP address and other network configuration settings. This process varies from one print server to another, so you need to follow the manufacturer's guidelines for information on how to do this. Next, you need to install the print server software and follow the manufacturer's guidelines for configuring the printer. The vendor's software configures everything; usually no additional software configuration is required.

Caution

Be Careful Using Print Manager to Add a Network Printer Unless a printer uses the lpd protocol, you should not use Print Manager to add, modify, or delete a network-based printer that is connected directly to a network with its own network interface card. You won't damage anything if you try this, but your printer will not be recognized by the system, even though the printer might appear in the printer tool window. You should always use the manufacturer-supplied software to manage the printer.


For printers that have parallel or serial connections, you must use the Solaris tools to configure the operating system to recognize the printer.

BSD Versus SVR4 Printing Software

The BSD Unix and SVR4 Unix are similar and yet different when it comes to the software that drives the Unix printing process. The two print systems are similar in that both are based on the concept of spooling. Both SVR4 and BSD print services support the concept of an interface program, which acts as a filter through which all output sent to the printer is passed. The following are examples of the uses of interface programs:

  • Adding a banner page Most Unix systems automatically add a banner page to the front of a print job. The purpose of the banner page is to identify the owner of the printer output in a shared printer setting.

  • Adding or removing a line-feed character Unix uses just the line-feed character to separate lines. The first problem you might encounter when testing a printer is that the text might come out in a stair-step manner. This problem can be overcome by installing the vendor's print software or interface file.

The differences between BSD and SVR4 are in the configuration files and the spooling directories, which the Solaris operating environment configures automatically. Differences also exist in the way the lpsched daemon handles print jobs as compared to the way the lpd daemon handles them in BSD.

SVR4 Print Service

In SVR4, one lpsched daemon services all printers. The lpsched daemon is continually running, and it provides the power for the print service. Only one instance of lpsched should be running at any time.

The LP print service performs the following functions:

  • Administers files and schedules local print requests

  • Receives and schedules network requests

  • Filters files (if necessary) so that they print properly

  • Starts programs that interface with the printers

  • Tracks the status of jobs

  • Tracks forms mounted on the printer

  • Delivers alerts to mount new forms or different print wheels

  • Delivers alerts about printing problems

Most of the lp configuration files are located in the /var/spool/lp directory, except for the interface files, which are located in the /etc/lp/interfaces directory. A SCHEDLOCK file should be in /var/spool/lp; it is responsible for ensuring that only one instance of lpsched runs. You use the lpadmin command to add, configure, and delete printers from the system.

Information about printers can be found in the /etc/printers.conf file and in files located in the /etc/lp directory. Solaris Print Manager provides a graphical interface to many of the lp commands listed in Table 6.2.

Table 6.2. Solaris Printing Commands

Command

Description

accept/reject

Enables or disables any further requests for a printer or class entering the spooling area.

cancel

Lets the user stop the printing of information.

enable/disable

Enables or disables more output from the spooler to the printer.

lp

Places information to be printed into the spooler.

lpadmin

Allows the configuration of the print service.

lpmove

Moves print requests between destinations.

lpsched

A script that runs the svcadm command to start the print service.

lpshut

A script that runs the svcadm command to stop the print service.

lpstat

Displays the status of the print service.


Although Solaris uses the SVR4 print model, it still supports BSD-style printing to provide interoperability. The widely used BSD printing protocol provides compatibility between different types of Unix and non-Unix systems from various manufacturers.

Print Servers Versus Print Clients

A print server is a system that has a local printer connected to it and makes the printer available to other systems on the network. A print client is a remote system that can send print requests to a print server. A system becomes a print client when you install the print client software and enable access to remote printers on the system. Any networked Solaris system with a printer can be a print server, as long as the system has adequate resources to manage the printing load.

The print client issues print commands that allow it to initiate print requests. The print command locates a printer and printer configuration information.

When a print job is sent from the print client, the user issues either the SVR4-style lp command or the BSD-style lpr command. Any one of the styles shown in Table 6.3 can be used to submit a print request.

Table 6.3. Valid Print Styles

Style

Description

Atomic

The print command and option followed by the printer name or class. Here's an example: lp -d neptune filename

POSIX

The print command and option followed by the server printer. Here's an example: lpr -P galaxy:neptune filename

Context

Context-based style as follows: lpr -d thisdept/service/printer/printer-name filename


If the user doesn't specify a printer name or class in a valid style, the command follows the search order defined in the /etc/nsswitch.conf file. By default, the command checks the user's PRINTER or LPDEST environment variable for a default printer name. These variables can be set in the user's startup file to specify a default printer to use. 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 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.

Configuring Software for a Solaris Printer

The print client software and the Print Manager application offer a graphical solution for setting up and managing printers in a networked environment. Print Manager provides a graphical interface to the lp commands listed in Table 6.2. The advantage of the Solaris Print Manager software is that it supports a name service (NIS or NIS+) that lets you centralize print administration for a network. If you're using a name service, Solaris Print Manager is the preferred method for managing printer configuration information. Using a name service for storing printer configuration information is desirable because it makes printer information available to all systems on the network, and that makes printing administration easier. The two tools are similar to one another and require the same type of information.

You can also use the lpadmin command at the command line to configure printers on individual systems. The next few sections describe how to set up a printer by using Print Manager and the command line.

Setting Up a Printer by Using Print Manager

Solaris Print Manager is a Java-based GUI that enables you to manage local and remote printer configuration. As with any Solaris GUI, your terminal must be able to display the X11 window environment in order to use this tool and you must be logged in as root.

You can follow the procedure in Step by Step 6.1 to set up a printer by using the Printer Manager.

Step By Step 6.1: Setting Up a Printer by Using Print Manager

1.
Log in as root on the system to which you want to connect the printer. The system on which you install the printer becomes the printer server.

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

3.
Start up Print Manager by typing the following:

/usr/sadm/admin/bin/printmgr &

The windows shown in Figure 6.1 appear.

Figure 6.1. The Print Manager startup windows.


4.
In the Select Naming Service window, select from the pull-down menu the name service you are using, as shown in Figure 6.2.

Figure 6.2. Selecting a name service.


5.
In the example in Figure 6.2, Files is selected from the pull-down menu because I am not using a name service at this time. After making your selection, click OK to continue. The Select Naming Service window closes.

6.
From the main Solaris Print Manager window, click the Printer menu from the top toolbar and select New Attached Printer, as shown in Figure 6.3.

Figure 6.3. The Solaris Print Manager window.


The New Attached Printer window appears, as shown in Figure 6.4.

Figure 6.4. The New Attached Printer window.


7.
Fill in the empty fields as follows:

  • Printer Name Enter the name you want to give this printer.

  • Description If you want to, enter a brief description of the printer.

  • Printer Port Click the button and select the port to which the printer is connected:

    /dev/term/a is serial port A.

    /dev/term/b is serial port B.

    /dev/bpp0 is the parallel port.

    /dev/ecpp0 is the parallel port on Sun Ultra systems.

Note

Parallel Port on PCI-Based Systems On the PCI-based Sun systems (that is, AX machines and Ultra 30, 450, 5, 10, and 60), the parallel port is called /dev/ecpp0 rather than /dev/bpp0, as on previous machines.

Select Other if you've connected an interface card with another device name.

  • Printer Type Click the button to select the printer type that matches your printer. The printer types here correspond to printers listed in the /usr/share/lib/terminfo directory. The printer type you select must correspond to an entry in the terminfo database. Unix works best with PostScript printers because page formatting of text and graphics from within the common desktop environment (CDE) is for a PostScript printer. If you want to set your printer type as a PostScript printer, your printer must be able to support PostScript. If you're using an HP LaserJet printer, you should choose HPLaserJet as the print type unless your LaserJet printer supports PostScript.

  • File Contents Click the button to select the format of the files that will be sent to the printer.

  • Fault Notification Click the button to select how to notify the superuser in case of a printer error.

  • Options Choose to print a banner or make this the default printer.

    Note

    Default Printers One printer can be identified as the default printer for the system. If a user does not specify a printer when printing, the job goes to the default printer.


  • User Access List If you want to, enter the names of the systems that are allowed to print to this printer. If nothing is entered, all clients are allowed access.

After you fill in all the fields, click the OK button. The window closes, and the new printer name appears in the Solaris Print Manager window, as shown in Figure 6.5.

Figure 6.5. The new printer name in the Solaris Print Manager window.



Using a Printer Not Listed on the Printer Types Menu

Printer types listed in the Print Manager window correspond to printers listed in the /usr/share/lib/terminfo directory. If a printer type is not available for the type of printer you are adding, you might need to add an entry in the /usr/share/lib/terminfo database. Each printer is identified in the terminfo database by a short name; for example, an HP LaserJet printer is listed under the /usr/share/lib/terminfo/h directory as HPLaserJet. The entries for PostScript printers are in /usr/share/lib/terminfo/P. The name found in the directory is the printer type you specify when setting up a printer.

If you cannot find a terminfo entry for your printer, you can try selecting a similar type of printer; however, you might have trouble keeping the printer set in the correct modes for each print request. If no terminfo entry exists for your type of printer and you want to keep the printer set in the correct modes, you can either customize the interface program used with the printer or add an entry to the terminfo database. You'll find the printer interface program located in the /etc/lp/interfaces directory. Editing an interface file or adding an entry to the terminfo database is beyond the scope of this book. A printer entry in the terminfo database contains and defines hundreds of items. Refer to the Solaris System Administration Guide: Advanced Administration at http://docs.sun.com for information on performing this task. Another good reference for this topic is John Strang and Tim O'Reilly's book termcap & terminfo, published by O'Reilly & Associates, Inc.

Setting Up a Printer by Using the lpadmin Command

If you are unable to use Print Manager, you can add a printer directly from the command line by using the lpadmin command. This method of setting up a printer provides the most flexibility, so if you're comfortable with using the command line, you should use it. The lpadmin command enables you to do the following:

  • Define or remove printer devices and printer names.

  • Specify printer interface programs and print options.

  • Define printer types and file content types.

  • Create and remove printer classes.

  • Define, allow, and deny user lists.

  • Specify fault recovery.

  • Set or change the system default printer destination.

By using lpadmin, you can set all the print definitions, whereas Solaris Print Manager allows you to set only some of them when you install or modify a printer.

Before you use the lpadmin command to add a printer, you first need to gather the following information about the printer you are going to set up:

  • Printer name

  • Port device

  • Printer type

  • File content type

To set up a printer that is connected to the parallel port on a Sun Ultra system from the command line, you follow the procedure in Step by Step 6.2.

Step By Step 6.2: Setting Up a Printer by Using lpadmin

1.
Use the lpadmin command to define the printer name and the port device that the printer will use:

lpadmin -p ljet1 -v /dev/ecpp0

Note

lpadmin Error Message You might see an error such as this:

UX:lpadmin: WARNING: "/dev/ecpp0" is accessible by others.
TO FIX: If other users can access it you may get unwanted output.
 If this
is not what you want change the owner to "lp" and change the mode
 to 0600.
Processing continues.

You can choose to modify permissions on this device file or leave them as is. If you modify permissions on /dev/ecpp0, when the print server and the print client are the same machine, the interface scripts run as the user that submitted the job. Therefore, if a user other than lp or root submits a job, the job will not have write access to /dev/ecpp0.

2.
Set the printer type of the printer:

lpadmin -p ljet1 -T PS

3.
Specify the file content types to which the printer can print directly:

lpadmin -p ljet1 -I postscript

4.
Accept print requests for the printer:

accept ljet1

The system responds with the following:

destination "ljet1" now accepting requests

5.
Enable the printer:

enable ljet1

The system responds with the following:

printer "ljet1" now enabled

6.
Add a description for the printer:

lpadmin -p ljet1 -D "Engineering PS Printer"

7.
Verify that the printer is ready:

lpstat -p ljet1

The system responds with the following:

printer ljet1 is idle. enabled since Dec 12 11:17 2005. available.


You now know how to set up a printer by using the command line. Next you'll learn how to manage printers by using the lpadmin command.


Previous Page
Next Page