[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netsaint-devel
Subject:    [netsaint-devel] Log rotation does odd things if NTP is called at the time
From:       Simon Huggins <shuggins () axialys ! net>
Date:       2000-11-13 14:45:11
[Download RAW message or body]

Log rotation doesn't work properly if I change the clock back at the
same time the log rotation is run.

So don't do that then.

Yes, ok, but isn't this a bug in Netsaint?  Shouldn't the filename be
determined *before* the event is run so that when the event for
log_rotation is run it uses whatever the time *should* be to determine
the filename to rename the current log to.

That way the trends cgi and anything else that looks for old logs will
find them in the files as expected.

At the moment I end up with:
64114 nov 11 22:51 netsaint-11-11-2000-23.log
   33 nov 11 23:59 netsaint-11-12-2000-00.log

Which seems silly.

The second file just contains:
[973983594] LOG ROTATION: WEEKLY

=> perl -e 'print scalar localtime(973983594)'
Sat Nov 11 23:59:54 2000

And ntpdate logged that it pushed the clock back just over 6 seconds.

It seems to have logged the log rotation weekly twice.  I have one in my
current netsaint.log followed by a " Warning: A system time change of 6
seconds (backwards in time) has been detected.  Compensating..."

The date of the other file matches with the timestamp of the last event
in the file (973979471).

Moving netsaint-11-11-2000-23.log to netsaint-11-12-2000-00.log makes
things like the trends CGI and so on work again.



Simon.

-- 
        Black Cat Networks        -(    "Her name is Bambi?" - Scully    )-
UK domain, email and web hosting  -(                                     )-
http://www.blackcatnetworks.co.uk -(                                     )-

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic