HP-UX_Administering the LP Spooler

Embed Size (px)

Citation preview

  • 8/10/2019 HP-UX_Administering the LP Spooler

    1/11

    HP-UX System Administrator's Guide: Routine Management Tasks: HP-UX 11i Version 3> Chapter 4 Managing

    Printers

    Administering the LP Spooler

    Table of Contents Index

    The following procedures are used to administer the LP Spooler:

    Stopping and Restarting the LP Spooler

    Controlling the Flow of Print Requests

    Enabling or Disabling a Printer

    Setting a Printers Fence Priority

    Changing a Printers Default Request Priority

    Table 4-1in Summary of Additional Printer Tasksgives further system-administration instructions for common management tasks.

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

    Table 4-3and Table 4-4list 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 LPto 0.)

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    1 of 11 29/10/2014 04:47 p m

  • 8/10/2019 HP-UX_Administering the LP Spooler

    2/11

    1 of 11 29/10/2014 04:47 p m

  • 8/10/2019 HP-UX_Administering the LP Spooler

    3/11

    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 -ooption prints the output of all output requests; the -ioption inhibits the reporting of remote requests (that is, lpstatshows

    local requests only).

    Stop the LP spooler.

    /usr/sbin/lpshut

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

    3.

    Restart the LP spooler.

    /usr/sbin/lpsched

    4.

    When the spooler is restarted, any print request actively being printed at the time the lpshutcommand 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

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    3 of 11 29/10/2014 04:47 p m

  • 8/10/2019 HP-UX_Administering the LP Spooler

    4/11

    To allow print requests to be sent to a printer or to a printer class, use the acceptcommand. 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 rejectcommand. For example:

    /usr/sbin/reject lj

    NOTE: If the rejectcommand 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 acceptcommand on the class is reissued.

    If, however, you execute rejectfor 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 acceptcommand. See reject(1M) for details.

    Enabling or Disabling a Printer

    You can use HP SMH or the HP-UX commands enableand disableto activate or deactivate a printer for printing. You do not need superuser capabilities for

    these commands.

    You can issue individual enableand disablecommands 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 rejectcommand.

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

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    4 of 11 29/10/2014 04:47 p m

  • 8/10/2019 HP-UX_Administering the LP Spooler

    5/11

    Setting a Printers Fence Priority

    A fence priorityis 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 printers 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:

    Ensure that you have superuser capabilities.

    1.

    Stop the LP spooler:

    /usr/sbin/lpshut

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

    2.

    Set the printers fence priority (use a value from 0 to 7). For example:

    /usr/sbin/lpfence myprinter 5

    3.

    Restart the LP spooler:

    /usr/sbin/lpsched

    4.

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    5 of 11 29/10/2014 04:47 p m

  • 8/10/2019 HP-UX_Administering the LP Spooler

    6/11

    Ad i i t i th LP S l htt // k /d t / l /h / /5992 4616/ h04 01 ht l

  • 8/10/2019 HP-UX_Administering the LP Spooler

    7/11

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

    lj1and lj2represent printers.

    Table 4-1 Additional Printing Tasks

    Task Example Additional Information

    Move a print request to another

    location. lpalt LJ-1234 -dlj2 lj2is a destination printer or printer class. See lpalt(1).

    Cancel a print request. cancel LJ-1234 LJ-1234is a unique request ID number returned by lpor lpalt. See

    cancel(1), lp(1), and lpalt(1).

    Change the priority of print requests. lpalt LJ-1829 -p3 This changes LJ-1829s priority to 3. See lpalt(1).

    Display statistics about LP spooler

    activity.

    lpana To log spooler activity, start the spooler by entering lpschedwith 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

    lj1and lj2are source and destination printers or printer classes. You must

    issue lpshutand lpsched. See lpmove(1M) and lpsched(1M).

    View the status of printers and print

    requests.

    lpstat For detailed status information on the spooler, print requests, and printers,

    use the -toption to lpstat. See lpstat(1).

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    7 of 11 29/10/2014 04:47 p m Ad i i t i th LP S l htt // k /d t / l /h / /5992 4616/ h04 01 ht l

  • 8/10/2019 HP-UX_Administering the LP Spooler

    8/11

    Solving Common Printer Problems

    Table 4-2summarizes printer problems and possible solutions.

    Table 4-2 Printer Problems and Solutions

    Problem Solution

    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/logfor possible clues about the problem.

    Output being printed is not what you want. Cancel the job. For example:

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    8 of 11 29/10/2014 04:47 p m Administering the LP Spooler http://www kumanov com/docstore/manuals/hp ux/en/5992 4616/ch04s01 html

  • 8/10/2019 HP-UX_Administering the LP Spooler

    9/11

    Problem Solution

    cancel laserjet-1194

    Printing does not resume after paper jam orpaper out.

    To restart a listing from the beginning:

    Take printer offline1.

    Issue the disablecommand2.

    Clear jam or reload paper3.

    Put printer online4.

    Issue the enablecommand5.

    To restart a listing from the stopping point:

    Take printer offline.1.

    Clear jam or reload paper2.

    Put printer online.3.

    If printing does not resume, issue the enablecommand4.

    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.

    Enter

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    9 of 11 29/10/2014 04:47 p m Administering the LP Spooler http://www kumanov com/docstore/manuals/hp ux/en/5992 4616/ch04s01 html

  • 8/10/2019 HP-UX_Administering the LP Spooler

    10/11

    Problem Solution

    rm /var/spool/lp/SCHEDLOCK

    and try again (you must be superuser).

    The LP spooler will not stop when using

    lpshut.

    Enter

    kill-15 process_id

    where process_idcan be found with the

    ps -ef | grep lpsched

    command (seeps(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

    Command Description

    lp(1) Sends a print request to a printer or plotter

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html

    10 of 11 29/10/2014 04:47 p m Administering the LP Spooler http://www kumanov com/docstore/manuals/hp ux/en/5992 4616/ch04s01 html

  • 8/10/2019 HP-UX_Administering the LP Spooler

    11/11

    Command Description

    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

    Command Description

    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.

    Administering the LP Spooler http://www.kumanov.com/docstore/manuals/hp-ux/en/5992-4616/ch04s01.html