> From [EMAIL PROTECTED] Wed Jun 28 15:36:22 2000
> Date: Wed, 28 Jun 2000 23:23:07 +0200 (CEST)
> From: Jesper Dangaard Brouer <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: Accounting and file descriptor 3 
>
>
> I want file descriptor 3 back!!!
>
>
> In the "old" versions of LPRng, file descriptor 3 was assigned to the name
> of accounting file or server (server option :af=host%port).  
> (Just as specified by the man page printcap(5))
>
> I'm using "af" as an server option (":af=host%port"), and setting the
> "achk" option. This workes just fine. That is sending "as" string to
> host%port, and returning "accept" og "hold".
>
> Now what does NOT work (anymore):
>
>  When I call my accounting.sh script from "ifhp", then file descriptor 3
>  is no longer assigned to the "accounting file or server".
>
> I note, that I'm currently using LPRng v.3.5.1 where this works. (I'm
> opgrading to v.3.6.19). The problem is not in "ifhp" (at least ver.3.3.1,
> this version have been corrected, i mailed the bugfix ;-))
>
>
> Are the any chances that I get file descriptor 3 back?
>
> Hilsen
>   Jesper Brouer

I might add an option to do this,  say, 'open_accounting_port',  but
it would not be provided by default.

I am a bit puzzled on this.  Right now you get the same effect for the :achk
option,  which is called BEFORE any connections to the printer are opened.

So you are trying to connect to the accounting server using the
'ifhp' accounting script facility.  Why not just write the page
count out to a file (where you have a permanent record) and don't
depend on the network connection.

The problem is that when the connection to the accounting server
is terminated,  this opens a lovely way to avoid the accounting
procedures.

For example,  if a student^H^H^H^H^H^H user is on the same
(non-switched) network as the accounting server or the print server,
when the connection is opened the student^H^H^H^H^H^H user can use
the 'Whack' DOS program to send a forged RST packet to either end
of the connection.  The TCP/IP stack then closes the connection
and the next read or write (at either end) will get an error.

The accounting script happily runs UNLESS you have taken extreme
precautions to check for errors on reads and writes,  and you
merrily proceed,  thinking that the accounting information has
been updated.

OK,  so how can we fight this?  Well, you can't
really.  But you can make a PERMANENT record of the information,
and then connect to the server after the record has been made,
and update the server QUICKLY by opening a new connection.  If the
update to the server fails, you still have the accounting information.

You need to be able to deal with a terminated connection by
having the accounting script reopen the connection if it has been
closeed.

You should log the accounting information locally and THEN deal with
updating the server,  and deal with reopening failed connections,
read errors, write errors, etc by reopening and retrying.
This connection open and retry should be done in the accounting
script,  where it can hammer away several times,  rather than
having a one-shot effort done by the LPD server.

See the latest version of the LPRng/UTILS/accounting.pl script for
a script that handles the information in the accounting file.
You can add your code to update and/or query the server pretty
easily to it.

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