Previous Page
Next Page

Key Terms

Exercises

6.1. Configuring a Printer by Using lpadmin at the Command Line

This exercise shows you how to add and remove a local LaserJet 5M printer 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 available for the installation:

Printer name: hp1

Port device: /dev/ecpp0

System type: Ultra5

Printer type: HP LaserJet5M

File content type: PostScript/PCL

Estimated time: 10 minutes

1.
As root, use the lpadmin command to add the printer named hp1 to the parallel port (/dev/ecpp0), set the printer type as hplaser, and specify the file content type as any:

lpadmin -p hp1 -v /dev/ecpp0 -T hplaser -I any

Now, start accepting print requests for the printer and enable the printer:

enable hp1
accept hp1

2.
Verify that the printer is set up and ready:

lpstat -p hp1 -l

3.
Send a print job to the printer to test it:

lp -d hp1 /etc/hosts

4.
Remove the printer:

lpadmin -x hp1

5.
Verify that the printer has been removed:

lpstat -t

6.2. Configuring a Printer by Using the Print Manager GUI

In this exercise, you add a LaserJet 5M printer to the print server by using the Print Manager GUI.

Estimated time: 5 minutes

1.
As root, start up Print Manager:

/usr/sadm/admin/bin/printmgr &

2.
From the Printer button at the top of Print Manager window, select New Attached Printer. Fill in the fields as follows:

Printer name: hp1

Description: Hplaser 5M

Printer port: /dev/eccp0

Printer type: HP Printer

File contents: Any

Fault notification: Mail to Superuser

Click OK when you're finished, and then exit Print Manager.

3.
Verify that the printer is set up and ready by typing the following:

lpstat -p hp1 -l

6.3. Stopping and Starting the LP Print Service

In this exercise, you use the svcadm disable command to stop and start the LP print service.

Estimated time: 5 minutes

1.
Halt the LP print service:

svcadm disable application/print/server

Any printers that are currently printing when the command is invoked are stopped.

2.
Use the svcadm enable command to start the LP print service:

svcadm enable application/print/server

Printers that are restarted by using this command reprint all jobs that were interrupted with the svcadm disable command.

6.4. Setting Up a Network-Based Printer

This exercise illustrates how to configure a printer named hplaser that is connected directly to the network via its own network interface card that has the IP address 192.168.1.10. In this example, the printer is utilizing an HP JetDirect interface, and you use Hewlett-Packard's JetAdmin software to configure the printer.

Estimated time: 15 minutes

1.
Obtain the JetAdmin software from Hewlett-Packard's website (www.hp.com) and install it using the pkgadd command, as described in Chapter 2, "Installing the Solaris 10 Operating Environment." Make sure you get the correct version of JetAdmin. As of this writing, the current version is named SOLd621.PKG. Put the downloaded file in your /tmp directory.

2.
Install the JetAdmin package into the /opt/hpnp directory by using the pkgadd command:

pkgadd -d /tmp/SOLd621.PKG

You should see the following output:

The following packages are available:
  1  HPNP     JetAdmin for Unix
              (sparc) D.06.21
Select package(s) you wish to process\
 (or 'all' to process all packages).
(default: all) [?,??,q]: 1

3.
Type the following:

1 <return>
Processing package instance <HPNP> from </var/spool/pkg/SOLd621.PKG>
JetAdmin for Unix
(sparc) D.06.21
(c)Copyright Hewlett-Packard Company 1991, 1992,\
 1993. All Rights Reserved.
(c)Copyright 1983 Regents of the University of\
 California
(c)Copyright 1988, 1989 by Carnegie Mellon\
 University
              RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S.\
 Government is subject to restrictions as set\
 forth in sub-paragraph (c)(1)(ii) of the Rights\
 in Technical Data and Computer Software clause\
 in DFARS 252.227-7013.
                  Hewlett-Packard Company
                  3000 Hanover Street
                  Palo Alto, CA 94304 U.S.A.
Where should HPNP be installed?
(<return> for /opt/hpnp) [?,q] <enter>

4.
Keep all the default selections by pressing Enter <return> to install the JetAdmin package in the /opt/hpnp directory:

HPNP will be installed in /opt/hpnp.
Please configure the sub-packages you would like\
 to install.
-------------------------------------------
Done altering installation configuration
    1. [ N/A ]  JetPrint
    2. [ On  ]  JobMonitor
    3. [ On  ]  HPNPF
    4. [ On  ]  HPNPD
    5. [ On  ]  CONVERT
    ?.          Help
---------------------------------------------
Select a number to toggle an installation option.
When done select 0. Select ? for help information: 0

5.
Enter 0 <return>, and the JetAdmin package is installed. You should see the following messages appear onscreen as the package is installing:

Select a number to toggle an installation option.
When done select 0. Select ? for help information: 0
Using </> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already\
 installed.
The following files are already installed on the\
 system and are being used by another package:
  /etc <attribute change only>
  /etc/init.d <attribute change only>
  /etc/rc1.d <attribute change only>
  /etc/rc2.d <attribute change only>
  /usr <attribute change only>
  /usr/bin <attribute change only>
Do you want to install these conflicting files\
 [y,n,?,q] y

6.
Enter y <return> to install the conflicting packages.

This package contains scripts which will be\
 executed with super-user permission during\
 the process of installing this package.
Do you want to continue with the installation\
 of <HPNP> [y,n,?] y

7.
Enter y <return> to continue the installation. You should see a list of files being installed, followed by this message:

Installation of <HPNP> was successful.

8.
Configure the HP LaserJet printer by using the JetAdmin utility that you just installed:

/opt/hpnp/jetadmin

The following information is displayed:

*************************************************
*                   MAIN MENU                   *
*  HP JetAdmin Utility for UNIX (Rev. D.06.21)  *
*************************************************
   1) Configuration (super-user only):
     - configure printer, add printer to spooler
   2) Diagnostics:
     - diagnose printing problems
   3) Administration (super-user only):
     - manage HP printer, JetDirect
   4) Administration (super-user only):
     - manage JetAdmin
   5) Printer Status:
     - show printer status, location, and contact
                   ?) Help         q) Quit
Please enter a selection (q - quit):1

Enter 1 <return> to configure a new printer:

Printer Network Interface:
Create printer configuration in BOOTP/TFTP database
2) Remove printer configuration from BOOTP/TFTP
          Spooler:
Add printer to local spooler
Delete printer from local spooler
Modify existing spooler queue(s)
               ?) Help            q) Quit
Please enter a selection: 3

Enter 3 <return> to add your printer to the local spooler:

Enter the network printer name or IP address \
(q - quit): 192.168.1.10

Enter the IP address for your printer. In this example, I entered 192.168.1.10:

Following is a list of suggested parameter \
values for this queue. You can change any \
 settings by selecting the corresponding \
non-zero numbers. The values will be used to \
configure this queue when '0' is selected.
To abort the operation, press 'q'.
Configurable Parameters:           Current Settings
-----------------------            ----------------
   1) Lp destination (queue) name   [192_1]
   2) Status log                    [(No log)]
   3) Queue class                   [(not assigned)]
   4) JobMonitor                    [OFF]
   5) Default queue                 [NO]
   6) Additional printer configuration...
Select an item for change, or '0' to configure \
(q-quit):1

Enter 1 to change the name of the printer:

Currently used names:
hp1
Enter the lp destination name (default=192_1, q - quit): hplaser

Enter a name for the printer. In this example, I entered hplaser:

Following is a list of suggested parameter values \
for this queue. You can change any settings by \
selecting the corresponding non-zero numbers. \
The values will be used to configure this queue \
when '0' is selected.
To abort the operation, press 'q'.
Configurable Parameters:          Current Settings
-----------------------           ----------------
   1) Lp destination (queue) name   [hplaser]
   2) Status log                    [(No log)]
   3) Queue class                   [(not assigned)]
   4) JobMonitor                    [OFF]
   5) Default queue                 [NO]
   6) Additional printer configuration...
Select an item for change, or '0' to configure \
(q-quit):0

Enter 0 to configure the printer settings you've defined:

Ready to configure hplaser.
OK to continue? (y/n/q, default=y)y

Answer y to start the configuration process.

The system displays the following messages as the printer is being configured:

Finished adding "hplaser" to the spooler.
Press the return key to continue ...

Enter <return>, followed by q, and another q to exit the JetAdmin utility.

9.
Verify that the printer is enabled and ready:

lpstat -p hplaser -l

The system displays information about the printer.

Exam Questions

1.

Which of the following commands does the Unix utility use for printing in SRV4 Unix?

  1. lpr

  1. lp

  1. lpd

  1. spool


2.

Where is the spool directory located in Solaris?

  1. /var/spool/lpd

  1. /var/spool/lp

  1. /usr/spool/lp

  1. /usr/spool/lpd


3.

Which of the following commands prevents queuing of print requests?

  1. disable

  1. cancel

  1. reject

  1. lpshut


4.

Which of the following can be used to add a local printer to a print server? (Select the two best answers.)

  1. SMC

  1. Print Manager

  1. lpadmin

  1. lp


5.

Which of the following commands stops the print service?

  1. lpsched

  1. lpshut

  1. cancel

  1. disable


6.

Which of the following commands submits the spooler information that is to be printed?

  1. lpd

  1. print

  1. lpsched

  1. lp


7.

Which of the following statements is true of a print server?

  1. It is a system that has a local printer connected to it.

  1. It is a remote system that can send print requests to another system for printing.

  1. It is a system that makes a printer available to other systems on the network.

  1. Printing can be initiated from it.


8.

If the user doesn't specify a printer name, which of the following environment variables tells the print service where to print?

  1. $HOME

  1. $LPDEST

  1. $PRINTER

  1. $DEFAULT_DEST


9.

When adding a printer by using Print Manager, what is the Printer Server field used for?

  1. It defines the name of the system to which the printer is connected.

  1. It defines the system as a print server.

  1. It selects a system from which to download the print software.

  1. It defines a system that can spool to the local printers.


10.

Which of the following is a serial port device?

  1. /dev/bpp0

  1. /dev/term/ttya

  1. /dev/term/a

  1. /dev/fd


11.

Which of the following are valid printer ports?

  1. /dev/terma

  1. /dev/term/a

  1. /dev/ecpp0

  1. /dev/term/ttya


12.

Which of the following commands cancels all print requests for the user bcalkins on the printer jetprint?

  1. lprm -bcalkins jetprint

  1. cancel -Pjetprint bcalkins

  1. cancel -u bcalkins jetprint

  1. lpremove -Pjetprint bcalkins


13.

Which of the following can be used to delete a printer?

  1. lpadmin -x<printer-name>

  1. lpshut <printer-name>

  1. Print Manager

  1. lpadmin -D <printer-name>


14.

Which of the following commands removes a job from the print queue?

  1. lpmove

  1. cancel

  1. lpremove

  1. reject


15.

Which of the following daemons services all printers?

  1. lpsched

  1. lpd

  1. lpr

  1. spoold


16.

Where is information on printers found?

  1. /etc/printers.conf

  1. /etc/lp

  1. /var/spool/lp

  1. /etc/print


17.

Which of the following is a system that has a local printer connected to it and makes the printer available to other systems on the network?

  1. Print server

  1. Print client

  1. Client

  1. Server


18.

Which of the following commands adds the printer luna to the class roughdrafts?

  1. lpadmin -p luna -c roughdrafts

  1. lpadmin -class roughdrafts -p luna

  1. lpadmin luna -c roughdrafts

  1. lpadmin -cp roughdrafts luna


19.

Which of the following commands displays the characteristics of the printer hplaser?

  1. lpstat -p hplaser -l

  1. lpstat -p hplaser

  1. lpadmin -p hplaser -l

  1. lpstat -a -p hplaser -l


20.

Which of the following commands changes a print request with the request ID eps1-29 to priority level 1?

  1. lp -i eps1-29 -q 1

  1. lpadmin -i eps1 -q 0

  1. lp -i eps1-29 -q 39

  1. lpadmin -i eps1 -q 39


Answers to Exam Questions

1.

B. The Unix utility responsible for printing in SVR4 Unix is called lp. For more information, see the section "The Solaris Print Service."

2.

B. For Solaris, the spool directory is located in /var/spool/lp. For more information, see the section "The Print Spooler."

3.

C. The reject command disables any further requests for a printer or class that is entering the spooling area. For more information, see the section "SVR4 Print Service."

4.

B, C. You can use Print Manager or lpadmin to add a local printer to a print server. For more information, see the section "Setting Up a Printer by Using the lpadmin Command."

5.

B. The lpshut command stops the print service. For more information, see the section "SVR4 Print Service."

6.

D. The lp command places information to be printed into the spooler. For more information, see the section "The LP Print Daemons."

7.

A, C. A print server is a system that has a local printer connected to it. A print server makes a printer available to other systems on the network. For more information, see the section "Print Servers Versus Print Clients."

8.

B, C. If the user doesn't specify a printer name or class in a valid style, the print command checks the user's PRINTER or LPDEST environment variable for a default printer name. For more information, see the section "Setting a User's Default Printer."

9.

A. When you use Print Manager to add a printer, the Printer Server field defines the name of the system (hostname) to which the printer is connected. For more information, see the section "Setting Up a Printer by Using Print Manager."

10.

C. /dev/term/a is the serial port A device, the primary serial port on a Sun system. For more information, see the section "Setting Up a Printer by Using Print Manager."

11.

B, C. Valid printer ports on a Solaris system include /dev/term/a, /dev/term/b, and /dev/ecpp0. For more information, see the section "Setting Up a Printer by Using Print Manager."

12.

C. The following command cancels all print requests for the user bcalkins on the printer named jetprint:

cancel -u bcalkins jetprint

For more information, see the section "Cancelling a Print Request."

13.

A, C. To delete a printer from the system, you can use either the lpadmin -x command or the Print Manager interface. For more information, see the section "Deleting Printers and Managing Printer Access."

14.

B. You use the cancel command to remove a job from the print queue. For more information, see the section "Cancelling a Print Request."

15.

A. The print scheduler, lpsched, handles print requests on print servers. For more information, see the section "Restarting the Print Scheduler."

16.

A, B. When you set up a printer with Print Manager or lpadmin, Solaris makes the required changes in the system's /etc/printers.conf file and the /etc/lp directory. For more information, see the section "The Solaris Print Service."

17.

A. 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. For more information, see the section "Print Servers Versus Print Clients."

18.

A. To add a printer to a class, you use the following command syntax: lpadmin -p <printer-name> -c <printer-class>. For more information, see the section "Creating Printer Classes."

19.

A. You use the lpstat command to display the characteristics of a particular printer:lpstat -p <printer-name> -l. For more information, see the section "Checking Printer Status."

20.

A. You use the lp command to change the priority of a print job to priority level 1: lp -i<job name> -q 1. For more information, see the section "Changing the Priority of a Print Request."


Previous Page
Next Page