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 Administrator's Guide: Routine Management Tasks: HP-UX 11i Version 3 > Chapter 4 Managing Printers

Administering the LP Spooler


Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The following procedures are used to administer the LP Spooler:

Table 4-1 in “Summary of Additional Printer Tasks” gives further system-administration instructions for common management tasks.

Table 4-2 in “Solving Common Printer Problems ” provides troubleshooting information for potential print-management difficulties.

Table 4-3 and Table 4-4 list HP-UX commands that may be used to handle print requests.

Stopping and Restarting the LP Spooler

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

The spooler must be stopped whenever the spooling system is modified (such as when adding or removing a printer) and then restarted after the modification is made. You can use either the HP System Management Homepage or HP-UX commands to stop or start the LP spooler.

Using HP SMH

  1. Access the HP SMH homepage as root.

  2. Select Tools,Printer Management,Save or Restore Print Spooler Configuration. This will display a tool launching page.

    NOTE: If your client console is a PC, you must have an X Window Server running before executing this function.
  3. Click on the Run button. This will display a printer management X Window.

    From the Actions pull-down menu,

    • Choose Stop Print Spooler to stop the LP spooler.

      HP SMH asks for confirmation before stopping the LP spooler.

    • Choose Start LP Spooler to start or restart the LP spooler.

      HP SMH asks whether you want it started with or without logging. If yes, logging information is kept in /var/adm/lp/log.

Using HP-UX Commands

  1. Ensure that you have superuser capabilities.

  2. Check for active print requests. Ideally, it is best to wait until there are no requests printing before stopping the LP spooler.

    /usr/bin/lpstat -o -i

    In the above command, the -o option prints the output of all output requests; the -i option inhibits the reporting of remote requests (that is, lpstat shows local requests only).

  3. Stop the LP spooler.


    All active print requests will stop, but remain in the print queue.

  4. Restart the LP spooler.


When the spooler is restarted, any print request actively being printed at the time the lpshut command was issued will be completely reprinted, regardless of how much of the request was previously printed.

Controlling the Flow of Print Requests

As superuser, you can use HP SMH or HP-UX commands to control the flow of print requests to the queues of named printers or printer classes.

Using HP-UX Commands

To allow print requests to be sent to a printer or to a printer class, use the accept command. For example:

/usr/sbin/accept laser1 jet2 lj

See accept(1M) for details.

To prevent print requests from being sent to a printer or printer class, use the reject command. For example:

/usr/sbin/reject lj
NOTE: If the reject command is executed on a printer class, but not on members of the class, users can still specify a specific printer (not the class) in subsequent print requests until an accept command on the class is reissued.

If, however, you execute reject for all individual printers in a class, but not for the class itself, the print requests will remain in the class request directory until at least one of the printers in the class is permitted to process print requests by the accept command. See reject(1M) for details.

Enabling or Disabling a Printer

You can use HP SMH or the HP-UX commands enable and disable to activate or deactivate a printer for printing. You do not need superuser capabilities for these commands.

You can issue individual enable and disable commands for each printer or issue one command separating each printer by blank spaces. For example:

/usr/bin/enable laser1 laser2 laser3

You can enable or disable individual printers only, not printer classes. By default, any requests printing when a printer is disabled are reprinted in their entirety when the printer is reactivated. A printer that has been disabled can still accept new print requests to be printed at a later time unless it has been prevented from doing so by the reject command.

See enable(1) anddisable(1) for details.

Setting a Printer’s Fence Priority

A fence priority is a value (0 to 7) associated with a printer and used to control access by print requests. A print request must have a value equal to or greater than the printer’s fence priority or it will remain on the print queue.

You can assign the fence priority using HP SMH or HP-UX commands.

To use HP-UX commands, follow these steps:

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:


    For more information, see “Stopping and Restarting the LP Spooler ”.

  3. Set the printer’s fence priority (use a value from 0 to 7). For example:

    /usr/sbin/lpfence myprinter 5
  4. Restart the LP spooler:


Changing a Printer’s Default Request Priority

  1. Ensure that you have superuser capabilities.

  2. Stop the LP spooler:


    For more information, see “Stopping and Restarting the LP Spooler ”.

  3. Change the priority. For example:

    /usr/sbin/lpadmin -pmyprinter -g7

    If you do not specify the -g option, the default request priority is set to zero.

  4. Restart the LP spooler:


Summary of Additional Printer Tasks

Table 4-1 summarizes additional printer tasks. Refer to the command’s manpage for details. In this table, LJ-1234 and LJ-1829 represent sample print requests; lj1 and lj2 represent printers.

Table 4-1 Additional Printing Tasks



Additional Information

Move a print request to another location.

lpalt LJ-1234 -dlj2

lj2 is a destination printer or printer class. See lpalt(1).

Cancel a print request.

cancel LJ-1234

LJ-1234 is a unique request ID number returned by lp or lpalt. See cancel(1), lp(1), and lpalt(1).

Change the priority of print requests.

lpalt LJ-1829 -p3

This changes LJ-1829’s priority to 3. See lpalt(1).

Display statistics about LP spooler activity.


To log spooler activity, start the spooler by entering lpsched with the -a option. Such data is useful for configuring the spooler system for optimum operation. See lpana(1M).

List request id numbers.

lpstat -o

See lpstat(1).

Move all print requests from one printer destination to another.

lpshut lpmove lj1 lj2 lpsched

lj1 and lj2 are source and destination printers or printer classes. You must issue lpshut and lpsched. See lpmove(1M) and lpsched(1M).

View the status of printers and print requests.


For detailed status information on the spooler, print requests, and printers, use the -t option to lpstat. See lpstat(1).


Solving Common Printer Problems

Table 4-2 summarizes printer problems and possible solutions.

Table 4-2 Printer Problems and Solutions



Printer will not print.

Check to see if the printer is enabled, is accepting requests, the scheduler is running, and the device file is correct. For example, specify

lpstat -t

Make sure the printer is plugged in and turned on.

Check to see whether the printer is out of paper or has a paper jam.

If the printer supports both serial (RS232) and parallel interfaces, verify that the cable is properly connected to the printer and the computer, and that the printer is configured for the correct interface.

If the printer is a remote printer, verify that the remote system and its spooler are running, verify that the printer is enabled and accepting requests on both local and remote systems, verify that the remote spooler daemon is running on the remote system. Check other entries in the procedure “Adding a Remote Printer to the LP Spooler ”.

If LP spooler was started with logging enabled, consult/var/adm/lp/log for possible clues about the problem.

Output being printed is not what you want.

Cancel the job. For example:

cancel laserjet-1194

Printing does not resume after paper jam or paper out.

To restart a listing from the beginning:

  1. Take printer offline

  2. Issue the disable command

  3. Clear jam or reload paper

  4. Put printer online

  5. Issue the enable command

To restart a listing from the stopping point:

  1. Take printer offline.

  2. Clear jam or reload paper

  3. Put printer online.

  4. If printing does not resume, issue the enable command

The LP spooler configuration needs to be restored.

Use the “Save/Restore Print Configuration” menu item in HP SMH.

The LP spooler will not start when using lpsched.


rm /var/spool/lp/SCHEDLOCK

and try again (you must be superuser).

The LP spooler will not stop when using lpshut.


kill-15 process_id

where process_id can be found with the

ps -ef | grep lpsched

command (see ps(1)).


Typical LP Commands for Users and LP Administrators

Any user can queue files to printers, get status of the LP system, cancel any print job, and mark printers in and out of service.

The following LP commands can be issued by any user. Consult the HP-UX manpage for options and usage.

Table 4-3 LP Spooler User Commands

lp(1)Sends a print request to a printer or plotter
lpstat(1)Prints information about the status of the LP spooler. Reports status of the scheduler, printers, printer classes, and default system printer.
cancel(1)Cancels print requests of spooled files, specified by request IDs.
enable(1)Changes the status of the named printer to activate it and enable it to print spooled requests.
disable(1)Changes the status of a named printer to deactivate it and disable it from printing spooled requests.
lpalt(1)Alters a printer request; issues a new request ID.


LP administrators can change the configuration of the system, mark printers in and out of service, start and stop the system.

Table 4-4 LP Administrator Commands

lpshut(1M)Shuts down the printer scheduler.
lpadmin(1M)Multifaceted command used to manage the LP spooler. Capabilities include adding/removing printers, changing class members, associating a device file with a printer, assigning an interface for a printer, setting a system default destination.
accept(1M)Allow a print destination to accept requests.
reject(1M)Prevent a print destination from accepting requests.
lpsched(1M)Schedules print requests for printing to destinations; typically invoked at system startup.
lpmove(1M)Moves requests from one printer to another.
lpfence(1M)Defines the minimum priority for which a spooled file can be printed.


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