> From [EMAIL PROTECTED] Fri Jun 23 09:17:48 2000
> Subject: LPRng: More accounting problems
> To: [EMAIL PROTECTED]
> Date: Fri, 23 Jun 2000 16:00:21 +0100 (BST)
> From: Jonathan Knight <[EMAIL PROTECTED]>
>
>
>
> Further to my previous mail I gave up using the accounting features of LPRng
> as they were clearly busted and apparently no longer useful.
>
> I went back as far as 3.6.12 and found the code was still broken but I can't
> see why as it looks like it should work as I expect it to.
>
>
> In order to get accounting back online I went for the ifhp accounting
> system using the "accounting" variable. I found:
>
> 1. The options as documented were not provided. In fact no options
> are put on the command line for the accounting script. The
> supplied sample script seems to expect them as well but I can confirm
> that none are sent.
>
> 2. The accounting.c file seems to intend to provide some data through
> the stdin of the script. However this doesn't match what the comment
> at the top of the file states is going to be provided. Also note that
> the file descriptor used to write the data into a temporary file (why?)
> is closed before the script is called so the script can never read it.
> So the accounting script get started with no options and its stdin
> has already been closed.
>
>
> I'm beginning to suspect that printer accounting is no longer something that
> recent editions of LPRng is used for. I don't mind putting in some time and
> effort sorting it out but I'd just like to check that someone else didn't
> change it to the current scheme for a reason.
>
See the comments NOW at the start of the accounting.c file:
/*
* Do_accounting()
* writes the accounting information to the accounting file
* This has the format:
*
* OF Mode start: start '-qpid' '-ppagecounter' '-Ttime' OPTIONS
* XF Mode start: filestart '-qpid' '-ppagecounter' '-Ttime' OPTIONS
* XF Mode end: fileend '-bpages' '-Telapsed' '-qpid' '-ppagecounter' '-Ttime'
OPTIONS
* OF Mode end: end '-bpages' '-Telapsed' '-qpid' '-ppagecounter' '-Ttime' OPTIONS
* OPTIONS - the ifhp filter command line options specified by the
* accounting_info value, usually "AnPR"
* This would result in '-Auser' '-nname' '-Pprinter' '-Rlpr_R_option'
*/
I think the other stuff is now working.
Example:
./ifhp -Fo -Taccounting=/tmp/acct.sh,dev=/tmp/out,ps_eoj_at_start@,model=hp8550,trace
-AAop -nName -Pprint -Racct /tmp/acct </tmp/one.ps 2>&1 | tee /tmp/log
/tmp/acct.sh:
#!/bin/sh
echo $0 "$@" >>/tmp/acct
/tmp/acct output:
start '-q1604' '-p0' '-t2000-06-24-16:46:46.411' '-AAop' '-nName' '-Pprint' '-Racct'
/tmp/acct.sh start -q1604 -p0 -t2000-06-24-16:46:46.411 -AAop -nName -Pprint -Racct
end '-b0' '-T0' '-q1604' '-p0' '-t2000-06-24-16:46:46.421' '-AAop' '-nName' '-Pprint'
'-Racct'
/tmp/acct.sh end -b0 -T0 -q1604 -p0 -t2000-06-24-16:46:46.421 -AAop -nName -Pprint -Ra
cct
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.
-----------------------------------------------------------------------------