From Wiki-UX.info

Wiki-UX / LP Spooler / How to remove pending Spool Job Requests
Jump to: navigation, search

How to remove pending Spool Job Requests

Contents

Abstract

This article explains how to remove all pending print jobs from the /var/spool/lp/request directory on a HP-UX 11i Operating Environment.

Background

Sometimes the linear printer spooler lpsched daemon can get overloaded when a large number of pending jobs exists. Sometimes a large number of control and data files are left in the /var/spool/lp/request directory, which can trash the spooler when the LP Spooler is restarted. Removing these jobs can release the resources to allow the spooler to function normally.

The following approach removes the control and data files from the request directory queue. This method is particularly effective when there are hundreds or thousands of pending printer jobs and the spooler itself does no start correctly due to this situation.

A common scenario is a system that has been just recovered from an Ignite backup or after /var directoy reached it's maximum capacity.

Other scenario is a large printer deployment where the print spooler has been running nonstop for months or years. The spooler is stopped for maintenance and when restarted is unable to process new print requests.

Always evaluate if you may need to backup /var/spool/lp/request directory before cleaning the spool jobs control and data files.

Procedure

1. Move into the print spooler directory.

# cd /var/spool/lp

2. Stop the print spooler. Verify that the lpsched is stopped.

# lpshut
scheduler stopped
 
# ps -ef | grep [l]psched

3. Verify that FIFO and SCHEDLOCK files are removed after stopping the scheduler. If they are not, just remove them.

# ll
total 32
lrwxr-xr-x   1 root       sys             18 Jul  1 15:37 cinterface -> /etc/lp/cinterface
lrwxr-xr-x   1 root       sys             13 Jul  1 15:37 class -> /etc/lp/class
lr-xr-xr-x   1 bin        bin             18 Jul  1 15:23 cmodel -> /usr/lib/lp/cmodel
-rw-r-----   1 lp         sys              0 Jul 15 11:34 default
lr-xr-xr-x   1 bin        bin             17 Jul  1 15:23 fonts -> /usr/lib/lp/fonts
lrwxr-xr-x   1 root       sys             12 Jul  1 15:37 info -> /etc/lp/info
lrwxr-xr-x   1 root       sys             17 Jul  1 15:37 interface -> /etc/lp/interface
lrwxrwxrwx   1 lp         lp              15 Jul 22 11:30 log -> /var/adm/lp/log
lrwxrwxrwx   1 lp         lp              19 Jul  8 11:33 lpd.log -> /var/adm/lp/lpd.log
lrwxr-xr-x   1 root       sys             14 Jul  1 15:37 member -> /etc/lp/member
lr-xr-xr-x   1 bin        bin             17 Jul  1 15:23 model -> /usr/lib/lp/model
-rw-r--r--   1 lp         lp               0 Jul  1 15:37 outputq
-rw-r--r--   1 lp         lp            1636 Aug  6 19:13 pstatus
-rw-r--r--   1 lp         lp             588 Jul 15 11:59 qstatus
drwxr-xr-x   2 lp         bin             96 Jul  1 15:37 receive
drwxr-xr-x   3 lp         bin             96 Jul 15 11:59 request
lrwxr-xr-x   1 root       sys             18 Jul  1 15:37 sinterface -> /etc/lp/sinterface
lr-xr-xr-x   1 bin        bin             18 Jul  1 15:23 smodel -> /usr/lib/lp/smodel

4. Move into the /var/spool/lp/request directory and check for job control and data files. It will be normal that a large number of all control and data files are left in the directoy. Take note if the list is particurly long.

# cd request
 
# find . -type f -name "[cd]*" -exec ll {} \;

Example:

# find . -type f -name "[cd]*" -exec ll {} \;
-r--r-----   1 lp         lp            2218 Oct 10  2006 /9400is1/dfA264ax3201c
-rw-r-----   1 lp         lp              77 Oct 10  2006 /9400is1/cfA264ax3201c
-r--r-----   1 lp         lp            1483 Feb  1  2008 /medp8435/dfA908ax3201c
-r--r-----   1 lp         lp            1447 Mar  5 12:19 /medp8435/dfA327ax3201c
-rw-r-----   1 lp         lp              81 Feb  1  2008 /medp8435/cfA908ax3201c
-r--r-----   1 lp         lp            1447 Mar  5 12:20 /medp8435/dfA337ax3201c
-rw-r-----   1 lp         lp              80 Mar  5 12:19 /medp8435/cfA327ax3201c
-rw-r-----   1 lp         lp              81 Mar  5 12:20 /medp8435/cfA337ax3201c
-r--r-----   1 lp         lp           24302 Jan  9  2007 /pmhp8142/dA0467hp607
-rw-r-----   1 lp         lp              92 Jan  9  2007 /pmhp8142/cA0467hp607
-r--r-----   1 lp         lp           24009 May 27  2007 /pmhp8142/dA1248hp607
-rw-r-----   1 lp         lp              93 May 27  2007 /pmhp8142/cA1248hp607
-r--r-----   1 lp         lp           23910 Oct 25  2006 /stvp8293/dA1191hp607
-rw-r-----   1 lp         lp              93 Oct 25  2006 /stvp8293/cA1191hp607
-r--r-----   1 lp         lp           24044 Oct 25  2006 /stvp8293/dA1404hp607

5. Remove all the control and data files from the jobs.

# find . -type f -name "[cd]*" -exec rm {} \; 

6. Start print spooler.

# lpsched
 
#  ps -ef | grep [l]psched
      lp 11855     1  0 15:23:34 ?         0:00 lpsched

7. Try to print a new job and verify that it is sent correctly to the test printer.

# lp -d<PrinterName> /etc/hosts
# lpstat -t
scheduler is running
no system default destination
device for ''<PrinterName>'': /dev/null
''<PrinterName>'' accepting requests since Jul 15 11:59
printer ''<PrinterName>'' is idle.  enabled since Jul 15 11:59
        fence priority : 0
no entries

Reference

Authors

This page was last modified on 19 July 2010, at 16:18. This page has been accessed 3,776 times.