20 Aug 2004 19:24:45 PDT
Date: Fri, 20 Aug 2004 19:24:45 -0700 (PDT)
From: "James.Q.L" <[EMAIL PROTECTED]>
Subject: remove stalled job automatically in script
To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Hi,

It's been a while since my first question. that means LPRng has been
treating me well. :)

Now occasionally I have a job that stalled in the queue and piled up the
subsequent jobs forever.
then i have to manually remove the stalled job. so I am trying to remove
the stalled job
automatically when it happens. here, I have this portion of code at the
begining of the accounting
script.

&check_stalled_job;

sub check_stalled_job {
        my $lpq = `lpq -P$opt{P}`;
        if ($lpq =~ /stalled/) {
            `echo $lpq | mail -s "clear stalled job" $mail_on_error`;
            `/usr/sbin/lpc -kill $opt{P}`;
        }
}

I am expecting to check the stalled job by filter out the 'stalled'
keyword from lpq result. Now
that doesn't seems to be working ( never got any email notification ). I
couldn't reproduce the
stalled problem at present so it's very hard to spot the problem. 

I guess i am going to ask: Am i solving the problem the right way?

printcap file 

# common setup for all printers starts here.
#
.common
  :filter=/usr/local/LPRng/ifhp/libexec/filters/ifhp

  :as=|/usr/local/quotasrv/accounting.pl start
  :ae=|/usr/local/quotasrv/accounting.pl end

  :af=/var/spool/lpd/%P/acct
  :sd=/var/spool/lpd/%P
  :stalled_time=300
  :lpd_bounce
  :mx=0


TIA,

Qiang


                
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 



-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRng MAILING LIST
The address you post from or your Reply-To address MUST be your
subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.
To subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  call Patrick Powell or one of the friendly
staff at Astart Technologies for help.  Astart also does support for LPRng.
Also, check the Web Page at: http://www.lprng.com for any announcements.
Astart Technologies  (LPRng - Print Spooler http://www.lprng.com)
6741 Convoy Court
San Diego, CA 92111
858-874-6543 FAX 858-751-2435
-----------------------------------------------------------------------------

Reply via email to