Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Dec 1999 17:06:51 -0500 (EST)
From:      Will Andrews <andrews@TECHNOLOGIST.COM>
To:        Igor Roshchin <igor@physics.uiuc.edu>
Cc:        stable@FreeBSD.ORG
Subject:   RE: problem with wtmp in 3.x family
Message-ID:  <XFMail.991211170651.andrews@TECHNOLOGIST.COM>
In-Reply-To: <199912111826.MAA01536@alecto.physics.uiuc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11-Dec-99 Igor Roshchin wrote:
> I am not sure if this problem has been discussed here,
> but I could not find it in the archives, although I know
> a few people besides me who observed this problem.
> There is a bug which seems to exist in the 3.x family of FreeBSD.
> I haven't seen it in 2.x, and I observe it on a 3.1-stable 
> (19990412) box, as well as on a 3.3-RELEASE  box.

I see a similar problem in 3.3-STABLE (Nov 16) & 4.0-CURRENT (Sept 29).

> 1. The record in wtmp file is not updated properly.
> This seems to be happening when the connection dies (e.g. "reset by peer"),
> say, when a people connected from a ppp-via-dialup host gets kicked
> off by a modem, and the connection is not disconneted properly.
> 
> 2. The utmp record is not updated either.
> So, "w" shows a person being logged in, even though there are no processes
> running on that tty. (accordingly w shows "-" as a current process).
> When somebody else logs in on that tty, the utmp record is updated,
> but not the wtmp one.
> 
> In most cases, if not in all, the users use "screen".
> I am not sure if the use of screen is necessary condition or just 
> a coinsidence.

In my case, things are a little different. I have X11 + WindowMaker setup to
run a rxvt w/ top & xtail /var/log whenever it starts up. I never kill these
apps, so WindowMaker does the job. Unfortunately, the utmp & wtmp logs are
affected as you say above:

<2 5001-0> (99-12-11 17:02:42) [will@shadow ~]% w
 5:02PM  up 6 days, 19:40, 9 users, load averages: 1.02, 1.08, 1.07
USER             TTY      FROM              LOGIN@  IDLE WHAT
will             v0       -                12:59PM  4:03 xinit /home/will/.xini
will             p0       unix:0           12:59PM 6days top
will             p1       unix:0           12:59PM 27days xtail /var/log

Note that ttyp1's idle time is 27 days whereas my system uptime is only 6 days.
Also note that I've only been running X for 4 hours. Because WindowMaker
unconditionally kills these rxvt's, the utmp & wtmp files are not cleaned up
properly, and I get a result like the above.

Seems rather peculiar.. and you now know it's not restricted to `screen`. I'm
almost 100% certain that the cause here is the improper writing of certain utmp
and wtmp functions.

--
Will Andrews <andrews@technologist.com>
GCS/E/S @d- s+:+>+:- a--->+++ C++ UB++++ P+ L- E--- W+++ !N !o ?K w---
?O M+ V-- PS+ PE++ Y+ PGP+>+++ t++ 5 X++ R+ tv+ b++>++++ DI+++ D+ 
G++>+++ e->++++ h! r-->+++ y?


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.991211170651.andrews>