Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot clear /var/adm/ras/errlog

Status
Not open for further replies.

woche

Programmer
Jan 16, 2002
25
CH
Hello

I got a problem with the errclear utility: I get an &quot;unexpected eof&quot;-error every time the cron job starts the utility. The size of errlog = 0. Maybe it was cleared using &quot;> errlog&quot; - which doesn't seem to be a good idea (I don't understand why). so I copied the errlog from another Unix and there were no more error messages from cron. now I want to clear the errlog using errclear. Issueiung &quot;/usr/lib/errcler 0&quot; doesn't do anything (not even an error or something) and the errlog isn't cleared. It doesn't help, when i shut down the errdemon, and there's no improvement if I set up a command like &quot;/usr/lib/errclear -i <filename> 0&quot;.
hmm...any ideas?
thx
woche
 
I just helped someone with this a week back or so here on tek-tips. Do the following:

Remove /var/adm/ras/errlog

Run

/usr/lib/errdemon -s 1048576

This should re-create a new 1MB error log file in /var/adm/ras.

Bill.
 
Hi Bill
Thanks for your answer. It does create the errlog, but it's not empty - but maybe doesn't need to be:)
So: when I issue &quot;errclear 0&quot; the errlog stays the same in its content.

woche
 
What do you mean &quot;not empty&quot; ?

The error log file should not have a size of zero bytes. It should have the size specified when it was created.

Bill.
 
The errorlog can get corrupt...If the size was zero that is a dead giveaway that it is corrupt.....Even when you run errclear it is never zero

You can stop reporting, delete the file and recreate it with the errdemon command
which should correct the problem. (see below)

errclear 0 should clear the log after you recreate it......the size WILL NOT BE ZERO though... the only way you know it is empty is by running the errpt command, and it will not return any entries...and just return to a prompt.........
-----------------------------------------
errorlog files

/usr/lib/nls/msg/$LANG/codepoint.cat
Contains the error log message catalog. In the United States, the
value of the $LANG environment variable is En_US.

/usr/include/sys/err_rec.h
Contains structures defined as arguments to the errsave kernel
service and the errlog subroutine.
/var/adm/ras/errlog
Stores instances of errors and failures encountered by the
system.
/var/adm/ras/errtmplt
Contains the Error Record Template Repository.

/dev/error
Source of error records.
/usr/lib/errdemon
Contains the errdemon daemon.
/etc/objrepos/SWservAt
Contains the software service aids attributes object class;
that is, the error log configuration database.

-----------------------------------------
If too many entries are put in the errorlog before it is cleared or if someone uses the cp /dev/null to the file, it can corrupt it...

errstop, remove the file errlog and then restart the demon

To terminate the errdemon daemon, enter:
/usr/lib/errstop

cd /var/adm/ras and rm /var/adm/ras/errlog
To start the error-logging daemon, enter:
/usr/lib/errdemon
(you can set it up with a new log name and a new directory and size if you wish with flags)
My cron entry is: for root
0 11 * * * /usr/bin/errclear -d S,O 30
0 12 * * * /usr/bin/errclear -d H 90


 
Yes, I'm aware of that, but my understandign of the errclear utility is such, that it clears errlog from all its content (just like you can clear any file by issueing &quot;> myfile&quot;)...that doesn't happen. I read somewhere, that it's not good to clear the errlog by typing &quot;> errlog&quot;.
woche
 
thanks aixqueen
my last reply wasn't to your mail actually - I think they just crossed :)
In that case: thanks for your answer, especially the part of the file corruption. errpt returns to the command-prompt and so I guess, errlog &quot;is empty&quot;.

woche
 
The way &quot;errclear 0&quot; works is that it resets a counter somewhere around byte #5 of the errlog. This byte contains the record count of the number of errors in the errlog. errclear sets this value to zero, but technically, the errors are all still in the errlog.

Never do a &quot;>errlog&quot;. Always do an errclear 0.

Bill.
 
perfect - answers like these just send me flying - honestly!!!!
thanks guys
woche
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top