ac, wtmp, newsyslog

Garance A Drosihn drosih at rpi.edu
Fri May 2 23:33:29 PDT 2003


At 12:46 PM -0500 5/2/03, Eric Dedrick wrote:
>I've currently noticed on my system that logins which straddle
>a change in month no longer show up with ac.  I haven't looked
>at things too closely, but I think it is possible for a user
>to remain logged in long enough that they get "forgotten" when
>newsyslog rotates wtmp.
>
>Perhaps wtmp should be rotated by something a little smarter
>than newsyslog -- something that will never "forget" about
>users with current login sessions?

newsyslog is only for rotating files.  It has no special knowledge
of the contents of the files, and indeed there is no reason it
should have.

I'm pretty sure the issue comes up any time a person is logged
on over the course of a wtmp-rotation.  wtmp works by writing a
line when you log in, and then updating that line when you log
out.  If the file is rotated, then there *is* no line to update
when you log out.

I've heard that there are programs to intelligently-roll a wtmp
file, but I've never tracked them down.  "We" (freebsd) should
probably do something to improve on that for FreeBSD, in our
copious spare time...

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-questions mailing list