SUMMARY: read error file 0... reported by cron accounting

From: Dan Penrod (penrod@whiplash.er.usgs.gov)
Date: Wed Aug 04 1993 - 19:56:39 CDT


My original question:

>Every morning I get mail from cron from each and every Sun Sparc on
>my network complaining about read errors during accounting. I have
>been deleting these mail messages for quite some time, not knowing
>how to pacify this problem. In the /var/adm/acct/nite directory...
>my lastdate file shows today, my statefile shows COMPLETE, my fd2log
>has length 0 and is time/date stamped several days ago, my active
>file shows all the processes completed okay.
>Any else having similar trouble?

The solution:

I got two great answers. The first was a suggestion of how to insert
some debug lines into the script which might shed light on the cause
of the error such as ownership, filesize, write permission, etc.
I apologize, that note was deleted prematurely, so I cannot,
unfortunately, credit that Sun Manager. I followed his suggestion
which confirmed for me that it was not a permission problem, however
it did not shed light on the answer.

The second response came from (yes, I saved this one!) Brooks Cutter
(bcutter@paradyne.com) who hit the nail on the head. He said he
looked up the error message on SunSolve 1.3 (good thinking Brooks)
which found:
>SRDB ID : 5305
>SYNOPSIS : error message from Account /usr/lib/acct/runnacct
>DETAIL DESCRIPTION:
>The following errors from /usr/lib/acct/runacct are being seen on
>quiet days, e.g., Sunday accounting.
>acctmerg: read error file 0
>ptacct1.0421: read error file 0
>a: read error file 0
>The errors are due to runacct being invoked on a system with a zero
>length /var/adm/wtmp file. The previous day's accounting run has
>removed all entries 'old' entries from this file, and nobody has
>logged in since then. Hence when runacct gets started from cron,
>this file is zero length.
>SOLUTION SUMMARY:
>1. These error messages can be safely ignored. They do not corrupt
> daily accounting reports.
>or
>2. To eliminate the messages, alter the /usr/lib/acct/runacct and
> /usr/lib/acct/lastlogin script as follows. (Accounting patch
> 100407-05 should already have been installed.)
>Edit lastlogin and add "if" clause around acctmerge section, i.e:
>>...
>>if [ -s nite/ctacct.$_day ]; then
>>acctmerg -a < nite/ctacct.$_day | \
>> sed -e "s/^[^ ]*[ ]\([^ ]*\)[ ].*/$_d \1/" | \
>> sort -r +1 - sum/loginlog | uniq +10 | sort >sum/tmploginlog
>>cp sum/tmploginlog sum/loginlog
>>rm -f sum/tmploginlog
>>fi
>
>Edit runnacct and add two "iff clauses, firstly around acctcon2, e.g:
>>...
>cd ${_nite}
>>nulladm ctacct.${_date}
>>if [ -s ctmp ] ;then
>>acctcon2 < ctmp | acctmerg > ctacct.${_date}
>>
>>echo "connect acctg complete" >> ${_active}
>>fi
>>echo "PROCESS" > ${_statefile}
>>;;
>
>and another "if" clause around acctmerge, e.g:
>>...
>>cd ${_nite}
>>nulladm ctacct.${_date}
>>if [ -s ctmp ] ;then
>>acctcon2 < ctmp | acctmerg > ctacct.${_date}
>>
>>echo "connect acctg complete" >> ${_active}
>>fi
>>echo "PROCESS" > ${_statefile}
>>;;

This worked like a charm without the patch! Thanks again...

Dan Penrod
Unix Administrator
USGS Center for Coastal Geology
St.Petersburg, FL 33701
(813)893-3100 x3043
 



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:04 CDT