Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administration Tasks: HP 9000 > Chapter 10 Managing Printers and Printer Output

LP Spooler Tasks

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes common LP spooler tasks.

NOTE: You should add your printer(s) to the LP spooler if your system has more than one user at any given time. Otherwise, listings sent to the printer while another listing is printing will be intermixed, thus scrambling both listings.

Even if you have a single-user system, you may want to add your printer(s) to the LP spooler so you can queue print requests. This way, you do not have to wait for one request to complete before sending another.

Initializing the LP Spooler

Before you can use the LP spooler, you need to initialize it as follows:

  1. Add at least one printer to the LP spooler.

    See “Adding a Local Printer to the LP Spooler ” later in this chapter for details.

  2. Tell the LP spooler to accept print requests for this printer.

    Using the plumbing system analogy in Figure 10-1 “Line Printer Spooler "Plumbing" Diagram ”, this is equivalent to opening the accept/reject valves above the holding tanks. See “Controlling the Flow of Print Requests” later in this chapter for details.

  3. Tell the LP spooler to enable the printer for printing.

    In the plumbing system analogy, this is equivalent to opening the enable/disable valves below the holding tanks. See “Enabling or Disabling a Printer” later in this chapter for details.

  4. Turn on the LP spooler.

    See “Stopping and Restarting the LP Spooler ” later in this chapter for details.

(Note: If you use SAM to add a printer, SAM will do the above steps.)

Specifying the Printer Model File to the LP Spooler

When you configure your printer into the LP spooler, you must identify the printer interface script to be used. There are printer interface scripts you can choose from in the /usr/lib/lp/model directory. This directory contains files corresponding to the models and names of all HP printers and plotters (plus some generic model files). Table 10-1 “Model Files and Corresponding Printers and Plotters ” lists the names of the basic model files, the additional models to which they are linked, and the HP product numbers they support.

The /usr/sbin/lpadmin command will copy the identified model script to /etc/lp/interface/printername. See lpadmin(1M) for information on the command options.

If you are configuring a non-HP printer to HP-UX, read the ASCII model files to identify the essential printer characteristics — such as whether your printer uses Printer Command Language (PCL) or PostScript. Also see the manual that came with your printer for more information on PCL language levels. For third-party printers that are not PostScript printers, use the model dumb; for non-PostScript plotters, use dumbplot.

Table 10-1 Model Files and Corresponding Printers and Plotters

model File

Intended Purpose

HPGL1

LP interface for HP7440A HP7475A plotter; identical files: colorpro, hp7440a, hp7475a

HPGL2

LP interface for HP7550A, HP7596A, HP7570A plotter; identical files: hp7550a, hp7570a, hp7595a, hp7596a, draftpro

HPGL2.cent

LP interface for HP7550Plus, HP7550B plotters, and 7600 Series Electrostatic plotters when connected via parallel interface

PCL1

PCL level 1 model interface; identical files: hp2225a, hp2225d, hp2227a, hp2228a, hp2631g, hp3630a, paintjet, quietjet, thinkjet

PCL2

PCL level 2 model interface; identical files: hp2300-1100L, hp2300-840L, hp2560, hp2563a, hp2564b, hp2565a, hp2566b, hp2567b

PCL3

PCL level 3 model interface; identical files: deskjet, deskjet500, deskjet500C, deskjet550C, hp2235a, hp2276a, hp2932a, hp2934a, ruggedwriter

PCL4

PCL level 4 model interface; identical files: hp33447a, laserjet, hp5000f100

hp33440a

model file based on PCL level 4; identical files: hp2684a, hp2686a

PCL5

PCL level 5 model interface, identical files: hp5000c30, laserjet4Si, laserjetIIISi, laserjet4

deskjet1200C

LP interface based on PCL5; including support for language switching; identical file: deskjet1200C (this is the same file name as the model file), paintjetXL300

hpC1208a

LP interface for HP C1208A, based on PCL5

dumb

LP interface for dumb line printer

dumbplot

LP interface for dumb plotter

hp256x.cent

LP interface for the HP 256x family of line printers

postscript

LP interface for PostScript printer, for use on HP LaserJet IID, III, printers with HP 33439P LaserJet PostScript cartridge, as well as generic PostScript printers. Supports only RS-232-C, parallel interfaces.

rmodel

LP interface for remote printers.

 

Overview of Printer Types

A local printer is physically connected to your system. A remote printer is physically connected to another system. To access the remote printer, your system sends requests through the local area network (LAN) to the other system. To configure a remote printer into your local LP spooler, you must be able to access the remote system via the LAN.

A network-based printer differs from a remote printer. See “Adding a Network-Based Printer” later in this chapter for more information.

Adding a Local Printer to the LP Spooler

Adding a printer to the LP spooler differs from adding a printer to your system: adding a printer to the LP spooler involves configuring the LP spooler, whereas adding a printer to your system involves connecting the printer to your computer and configuring the needed drivers in the kernel. For information on the latter, refer to Configuring HP-UX for Peripherals.

The easiest way to add a local printer to the LP spooler is to run SAM. SAM will also do some of the HP VUE configuration (if HP VUE is being used) and some of the SharedPrint configuration (if you are using a SharedPrint printer model).

If you decide to use HP-UX commands instead, follow these steps:

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:

    lpshut

    For more information, see “Stopping and Restarting the LP Spooler ” later in this chapter.

  3. Add the printer to the LP spooler. For example:

    lpadmin -pchk_printer -v/dev/lp -mhp2934a -g7

    See lpadmin(1M) for details on the options.

  4. Allow print requests to be accepted for the newly added printer. For example:

    accept chk_printer

    See “Controlling the Flow of Print Requests” later in this chapter for information on accept.

  5. Enable the newly added printer to process print requests. For example:

    enable chk_printer

    See “Enabling or Disabling a Printer” later in this chapter for details.

  6. Restart the LP spooler:

    lpsched

Adding a Remote Printer to the LP Spooler

The easiest way to add a printer to a remote system is to run SAM. If you decide to use HP-UX commands instead, follow the above steps in “Adding a Local Printer to the LP Spooler ”, except replace Step 3 with the following:

  • If the remote printer is on an HP-UX system, enter:

    lpadmin -plocal_printer -v /dev/null -mrmodel \
    > -ormremote_machine -orpremote_dest -ocmrcmodel -osmrsmodel
  • If the remote printer is not on an HP-UX system, enter:

    lpadmin -plocal_printer -v /dev/null -mrmodel \ 
    > -ormremote_machine -orpremote_dest -ocmrcmodel -osmrsmodel -ob3

See lpadmin(1M) for details on the options.

If your remote printer does not work, check if the remote printing daemon (rlpdaemon) is correctly running on the remote machine (that is, the host on which the physical printer resides):

  1. Examine the file /etc/inetd.conf and look for the following line:

    # printer  stream tcp nowait root /usr/sbin/rlpdaemon  rlpdaemon -i

    If there is a # sign at the beginning of the line, the rlpdaemon line is commented out, preventing the printer from printing remotely.

  2. Edit the file /etc/inetd.conf to remove the # sign. Save the file.

  3. Check /etc/services and look for:

    #printer 515/tcp spooler #remote print spooling

    If there is a # sign at the beginning of the line, it is commented out. Edit the file to remove the # sign in the first column and save the file.

  4. Reconfigure the Internet daemon inetd, forcing it to reread the /etc/inetd.conf file:

    inetd -c

Also, check entries in /var/adm/inetd.sec that restrict which systems can send remote print requests.

Adding a Network-Based Printer

A network-based printer is connected directly to the LAN, thus is not physically connected to any system. Network printers do not use device special files.

You can use SAM to add a network-based printer that uses the HP JetDirect Network Interface. The HP JetDirect software must be installed on your system and you must be prepared to provide SAM with the printer's node name (the name associated with an Internet address) and the local name that the LP spooler will use to refer to the printer. With HP JetDirect, printers can connect directly to the network. The printer uses a LAN connection and the HP JetDirect software transmits prints requests. For more information, see HP JetDirect Network Interface Configuration Guide.

If you do not use SAM, follow the instructions shipped with your printer or the network interface card for the printer.

Creating a Printer Class

You can make efficient use of multiple printers by creating a printer class. A printer class is a name you use to refer to a group of printers. Print requests can then be spooled to a single print queue and print requests will be printed by the first available printer in the class. Thus, logjams on a particular printer are reduced or avoided. (Note that remote printers cannot belong to a printer class.)

You can use SAM to add a printer to a printer class when the printer is being added to the spooler; otherwise, you must use HP-UX commands. To use HP-UX commands, follow these steps after several printers have been added to the LP spooler:

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:

    lpshut

    For more information, see “Stopping and Restarting the LP Spooler ” later in this chapter.

  3. Create the printer class, specifying the printer you want to add to the class of printers. For example, to add a printer named laser1 to the class of printers named laser, enter:

    lpadmin -plaser1 -claser

    Only one printer can be added to a class at a time. If you have more than one printer to add, repeat this command.

    The lpadmin command can add a printer to a new class, add a printer to an existing class, or move a printer from one class to another class (a printer can only belong to one class).

  4. Allow print requests to be accepted for the newly added printer class. For example:

    accept laser
  5. Restart the LP spooler:

    lpsched

Removing a Printer from the LP Spooler

You can use SAM or HP-UX commands to remove a printer from the LP spooler. If you use SAM, SAM asks for confirmation before removing the printer. If there are print jobs in the printer's queue, or if the printer is the system default destination, SAM's confirmation message will include that information. If you choose to remove a printer that has jobs in its queue, SAM cancels those jobs.

If you use HP-UX commands, follow these steps:

  1. Ensure that you have superuser capabilities.

  2. (Optional): Notify users that you are removing the printer from the system.

  3. Remove the printer from the configuration file of any software application through which the device is accessed. (Refer to the documentation accompanying the software application for instructions.)

  4. Stop the LP spooler:

    lpshut

    For more information, see “Stopping and Restarting the LP Spooler ” later in this chapter.

  5. (Optional): Deny any further print requests for the printer. For example:

    reject -r"Use alternate printer." laser1

    By doing this step, you can be assured that no new jobs will appear before you remove the printer.

    Users will see the message "Use alternate printer" when they direct requests to a rejected destination if the printer has not yet been removed. Once the printer has been removed and a user tries to send a request, they will see the message "Destination printer_name non-existent". See “Controlling the Flow of Print Requests” later in this chapter for information on reject.

  6. (Optional): Determine if there are any jobs in the printer's queue. For example:

    lpstat -o laser1
  7. (Optional): Disable the printer to be removed. For example:

    disable -r"Printer laser1 is disabled." laser1

    You would issue the above disable command if there are jobs in the printer's queue and you do not want to wait for them to print before removing the printer. Issuing the disable command shuts the printer down in an orderly manner.

    For more information, see “Enabling or Disabling a Printer” later in this chapter. Note that you can also specify the -c option to the disable command to cancel all print requests for the printer.

  8. (Optional): If there are no jobs in the printer's queue, go on to Step 9. If there are jobs, decide whether to move all pending print requests in the request directory to another printer request directory or to cancel any requests. For example, to move print requests:

    lpmove laser1 laser2

    To cancel any requests:

    lpcancel laser1
  9. Remove the printer from the LP spooler. For example:

    lpadmin -xlaser1
  10. Restart the LP spooler:

    lpsched

See lpshut(1M), lpadmin(1M), and lpsched(1M) for details on the command options.

Removing a Printer from a Printer Class

SAM does not provide a way to you to remove a printer from a class. Instead, use HP-UX commands as follows:

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:

    lpshut

    For more information, see “Stopping and Restarting the LP Spooler ” later in this chapter.

  3. Remove the printer from the class. For example:

    lpadmin -plaser1 -rclass
  4. Restart the LP spooler:

    lpsched

See lpshut(1M), lpadmin(1M), and lpsched(1M) for details on the command options.

Removing a Printer Class

SAM does not provide a way to you to remove a printer class. Instead, use HP-UX commands as follows:

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:

    lpshut

    For more information, see “Stopping and Restarting the LP Spooler ” next in this chapter.

  3. (Optional): Deny any further print requests for the printer. For example:

    reject -r"Use alternate printer." laser1
  4. (Optional): Determine if there are any jobs in the printer's queue. For example:

    lpstat -o laser1
  5. (Optional): Move all pending print requests in the request directory for the printer class to another printer or printer class. For example:

    lpmove laser1 laser2
  6. Remove the printer class. For example:

    lpadmin -xlaser1
  7. Restart the LP spooler:

    lpsched

See lpshut(1M), reject(1M), lpmove(1M), lpadmin(1M), and lpsched(1M) for details on the command options.

When you remove a printer class, the printers in the class are not removed — you can still use them as individual printers. If you remove all printers from a class, that printer class is automatically removed.

Stopping and Restarting the LP Spooler

Typically, the LP spooler is started during the boot process. (To change the boot-up procedure by not starting the scheduler, edit the file /etc/rc.config.d/lp and set the shell environment variable LP to zero.)

The spooler must be stopped whenever the spooling system needs to be modified (such as when adding or removing a printer) and subsequently restarted after the modification has been made. You can use either SAM or HP-UX commands to stop or start the LP spooler.

If you use HP-UX commands to stop the LP spooler, follow these steps:

  1. Ensure that you have superuser capabilities.

  2. Check if there are any requests printing or being sent to a remote printer (it is best to wait until there are no requests printing before stopping the LP spooler).

    lpstat -o -i

    In the above command, the -i option inhibits the reporting of remote requests (that is, lpstat will only show local requests).

  3. Stop the LP spooler:

    lpshut

    All requests printing when lpshut is executed will be stopped, but will remain in the print queues.

  4. Restart the LP spooler:

    lpsched

When the spooler is restarted, the requests in the print queue will be completely reprinted regardless of how much of the request was printed prior to the shutdown. See lpshut(1M) and lpsched(1M) for details.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.