Setting Up the Software

For network printers, use the vendor’s software to configure the operating system. After you have completed the vendor software installation, you don’t need a further software configuration. You must obtain software from the printer manufacturer to install the printer on your system. Most 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 is to connect the print server to the network and set the IP address. This process varies on print servers, so follow the manufacturer’s guidelines for how to do this. Next install the print server software and follow the manufacturer’s guidelines for configuring the printer. The vendor’s software configures everything; no additional software configuration is required.

Caution

Don’t use Admintool or Print Manager to add, modify, or delete a network-based printer that is connected directly to the ethernet with its own network interface card. You won’t damage anything, but your printer will not be recognized by the system, even though the printer might appear in the printer tool window. Always use the manufacturer-supplied software to manage the printer.


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

BSD Versus SVR4 Printing Software

The software that drives the UNIX printing process is an area in which the two UNIX versions, BSD and SVR4, are similar and yet different. 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 some sample uses of an interface program:

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

  • 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 comes out in a stair-step manner. Most printers have a carriage return/line-feed and auto line-feed dip switch that controls what the printer will use. The stair-step problem can be fixed by modifying the interface program that performs the necessary translation on all output going to the printer or by setting the printer’s dip switch to the setting recommended by the hardware manufacturer.

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

BSD Print Service

Each printer connected to a BSD system must have its own spooling directory that is serviced by one lpd daemon. The spool directories are located in the /var/spool/lpd directory. Each printer has its own lpd daemon. In BSD, lpd accesses the file /etc/printcap for any information it requires concerning the printer. The printcap file is the system’s printer database file that stores all the necessary information about all printers connected to the system. To use a printer, that printer must have an entry in the /etc/printcap file. The lpr function is BSD’s equivalent to lp under SVR4. If users want to print something, they use the lpr command, which sends the necessary information to a specified spooling directory.

SVR4 Print Service

In SVR4, one lpsched daemon services all printers. The lpsched daemon is continually running and 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

  • Tracks print wheels currently mounted

  • 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 files located in the /etc/lp directory. Solaris Admintool provides a graphical interface to many of the lp commands listed in Table 24.2.

Table 24.2. Solaris lp 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 The user’s print command. Places information to be printed into the spooler.
lpadmin Allows the configuration of the print service.
lpmove Moves print requests between destinations.
lpsched Starts the print service.
lpshut Stops 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 systems from various manufacturers.

Print Server Versus Print Client

The print server is a system that has a local printer connected to it and makes the printer available to other systems on the network. The 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 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 24.3 can be used.

Table 24.3. Valid Print Styles
Style Description
Atomic The print command and option followed by the printer name or class. For example:
lp -d neptune filename 

POSIX The print command a nd option followed by server:printer. For example:
lpr -P galaxy:neptune filename 

Context Defined in the Federated Naming Service Programming Guide. For example:
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 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 Printer Manager application offer a graphical solution for setting up and managing printers in a networked environment. The advantage of the Printer 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 Printer 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, making printing administration easier. You’ll find that both tools are similar and ask for the same type of information.

You can also use the lpadmin command on the command line to configure printers on individual systems. Admintool provides an alternative method for installing printers in the Solaris environment. It provides a graphical interface to the lp commands listed in Table 24.2.

In the next few sections, I’ll describe setting up a printer using the Print Manager, AdminTool, and the command line.

Setting Up a Print Using Print Manager

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

First, 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. Connect your printer to the server and turn on power to the printer. Start up the Print Manager by typing the following:

/usr/sadm/admin/bin/printmgr & 

The windows shown in Figure 24.1 will display.

Figure 24.1. The Print Manager startup windows.


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

Figure 24.2. Select a naming service.


In the example, I selected Files from the pull-down menu because I am not using a naming service at this time. After making your selection, click OK to continue. The Select Naming Service window will close. From the main Solaris Print Manager window, click the Printer menu from the top toolbar and select New Attached Printer, as shown in Figure 24.3.

Figure 24.3. The Solaris Print Manager window.


The New Attached Printer window will appear, as shown in Figure 24.4.

Figure 24.4. The New Attached Printer window.


Fill in the empty fields as follows:

  • Printer Name Enter the name you want to call 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.

    Select Other if you’ve connected an SBUS 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 CDE is for a PostScript printer. If you want to select a PostScript printer, your printer must be able to support PostScript. If you’re using an HP LaserJet printer, 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.

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

Note

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


After filling in all the fields, click the OK button. The window closes, and the new printer name appears in the Solaris Print Manager window, shown in Figure 24.5.

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


Setting Up a Printer Using Admintool

This section describes how to use Admintool to set up the printer software.

You must run Admintool on the system to which you have attached the printer because it doesn’t allow you to make changes to a remote system. When setting up a printer, Admintool makes the appropriate changes in the system’s /etc/printers.conf file and /etc/lp directory.

Note

If you’re sitting at systemA and you want to connect a printer to systemB, you don’t need to get into your car and drive to that location to run Admintool on systemB. From systemA, simply login remotely to systemB and type the following:

admintool -display systemA:0.0 

SystemB’s Admintool should now be displayed on systemA, just as if you were sitting at systemB.


Exercise 24.1 Configuring a Printer Using Admintool

Follow these steps to configure a printer by using Admintool:

1.
Type admintool to bring up the Admintool menu. The Admintool window appears.

2.
Select Browse, Printers, as shown in Figure 24.6.

Figure 24.6. Selecting printers with Admintool.


The Printers configuration window appears, as shown in Figure 24.7. Existing printers are displayed.

Figure 24.7. The Printers configuration window.


3.
Choose Edit, Add.

4.
If you’re configuring a print client and the print server is located across the network, physically connected to another system, select Access to Printer from the pop-up menu shown in Figure 24.8.

Figure 24.8. The Printers window pop-up menu.


The Add Access to Printer window appears, as shown in Figure 24.9.

Figure 24.9. The Add Access to Printer window.


5.
Fill in the information in the window as follows:

  • Printer Name Enter the name of the printer on the remote system you want to access.

  • Print Server Enter the name of the system to which the printer is connected.

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

  • Option Check this option if you want to make this the system default printer.

6.
Click the OK button. The window closes, and the information is added to the appropriate LP print system files.

7.
If you’re configuring a print server and the printer will be connected to the local system, select Local Printer from the pop-up menu shown in Figure 24.8. This displays the window shown in Figure 24.10.

Figure 24.10. The Add Local Printer window.


8.
Fill in the fields as follows:

  • Printer Name Enter the name you want to call 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.

Select Other if you’ve connected an SBUS 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 CDE is for a PostScript printer. If you want to select a PostScript printer, your printer must be able to support PostScript. If you’re using an HP LaserJet printer, 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.

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

    Note

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


9.
After filling in all the fields, click the OK button. The window closes, and the new printer name appears in the Printers window (refer to Figure 24.7).

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 9 System Administration Guide,Volume II in the Answerbook2 online manuals 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 Using the lpadmin command

If you are unable to use Print Manager or Admintool, you can add a printer directly from the command line using the lpadmin command. If you’re comfortable with using the command line, this method of setting up a printer provides the most flexibility. 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

Using lpadmin you are able to set all of the print definitions, whereas Solaris Print Manager and Admintool only allow you to set 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

See the section “Setting up a Printer Using Admintool” earlier in this chapter for a complete description of each of these items.

Exercise 24.2 Setting Up a Printer Using lpadmin

1.
Start by giving lp ownership and sole access to a port device, as follows:

chown lp /dev/term/b 
chmod 600 /dev/term/b 

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

lpadmin -p ljet1 -v /dev/term/b 

3.
Set the printer type of the printer:

lpadmin -p ljet1 -T PS 

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

lpadmin -p ljet1 -I postscript 

5.
Accept print requests for the printer:

accept ljet1 

The system responds with the following:

destination "ljet1" now accepting requests 

6.
Enable the printer:

enable ljet1 

The system responds with the following:

printer "ljet1" now enabled 

7.
Add a description for the printer:

lpadmin -p ljet1 -D "Engineering PS Printer" 

8.
Verify that the printer is ready:

lpstat -p ljet1 

The system responds with the following:

printer ljet1 is idle. enabled since Jul 12 11:17 2001. available. 

This completes the process of setting up a printer using the command line. Next I’ll show you how to manage printers using the lpadmin command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset