> From [EMAIL PROTECTED] Mon Jun 26 02:30:05 2000
> Subject: Re: LPRng: Broken accounting in latest version
> To: [EMAIL PROTECTED]
> Date: Mon, 26 Jun 2000 09:12:50 +0100 (BST)
> From: Jonathan Knight <[EMAIL PROTECTED]>
>
> > Yes.  The problem here is that some filters INSISTED on an AF file
> > and they broke hard,  big time.  I spent 2 weeks working on this stuff
> > before I gave up.
>
>
> Let me get this straight:
>
> 1.  AF can no longer be a filter, it can only be a file or host%port

Yes.

> 2.  AS can be a filter and uses an exit status to say yes or no to printing

Yes.  format:
    as=start $P ...            this is a message for printing to the 
    as=|/bin/path start        this is a filter

> 3.  AE can be a filter but only gets the accounting end bit from LPRng

Yes.
    as=start $P ...            this is a message for printing to the 
    as=|/bin/path start        this is a filter

> 4.  The OF and IF filter get a file (if anything) on file descriptor 3 never
>     the AS or AE filters.

Yes.

> 5.  ifhp can run a filter as its accounting and will get the log lines.
>     The filter is opened once per log line.

Yes.

>
>
> Can I use the ifhp accounting filter to abort a job?  I'm wondering
> whether that's the place to do the following:

Yes.

>
> 1.   If the student is over quota then generate an "over quota" sheet
>      on the printer and abort their job.

Actually, you would probably want to 'JREMOVE' their file

> 2.   If the student is under quota then printer a banner with their quota
>      on it and then print their job

You would do this by using a combination of the accounting and
banner printing program.  This is how I do it:

  :as=  program

    #!/bin/sh
    ... code to check status, etc...

    # now generate the banner you want for the job
    cat <<EOF >banner.for.job
    ....
    EOF

  :bp=   program
    #!/bin/sh
    if [ -f banner.for.job ] ; then
                cat banner.for.job;
        fi;
    rm banner.for.job
    

> 3.   At the end of the job update the databases.

Yes, exactly so.

>
> I wasn't able to do this before because the AF filter didn't have access to
> the printer, but maybe that isn't true for the ifhp acounting script?

You read the accouting file to get the last printer accounting information.

Note: be ready to deal with jobs that have caused the printer to totally
lock up and cause the :of filter to abandon all attempts to get the accounting
information -  this has happened.  Usually you need to power the printer on
and off.

>
>
> -- 
>   ______    Internet  :[EMAIL PROTECTED]   Jonathan Knight,
>     /                                            Department of Computer Science
>    / _   __ Telephone : +44 1782 583437          University of Keele, Keele,
> (_/ (_) / / Fax       : +44 1782 713082          Staffordshire.  ST5 5BG.  U.K.
>

Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.astart.com)

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
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,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to