This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: who and utmp
- To: Dale Harris <rodmur@maybe.org>
- Subject: Re: who and utmp
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 16 Aug 1999 07:18:34 +0200
- Cc: glibc-linux@ricardo.ecn.wfu.edu
- References: <19990815123830.A24204@maybe.org>
- Reply-To: glibc-linux@ricardo.ecn.wfu.edu
>>>>> Dale Harris writes:
> Ok, turns out that they are coming out with a new version of sh-utils and
> it seems to pretty much work except that there may be a possible bug in
> glibc, it doesn't seem to remove old entries from utmp, notice:
> rodmur tty1 Aug 14 16:22
> rodmur ttyp0 Aug 14 16:22
> rodmur ttyp1 Aug 15 09:47
> rodmur ttyp2 Aug 14 16:25
That would be a problem with xterm/login etc not calling the correct
cleanup functions.
> I'm logged into the ttyp2 at this time, w from procps-2.02 appears to handle
> this correctly though:
> 12:35pm up 4 days, 22:01, 4 users, load average: 0.00, 0.01, 0.00
> USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
> rodmur tty1 - Sat 4pm 20:12m 12.43s 0.01s startx
> rodmur ttyp0 :0.0 Sat 4pm 0.00s 0.94s 0.31s mutt
> rodmur ttyp1 :0.0 9:47am 2:36m 0.26s 0.26s -bash
> So it could be a bug in who or glibc.
> Another thing that surprises me is the way utmp is accessed:
> access("/var/run/utmpd.rw", F_OK) = 0
> socket(PF_UNIX, SOCK_STREAM, 0) = 3
> connect(3, {sun_family=AF_UNIX, sun_path="/var/run/utmpd.rw"}, 110) = -1 ECONNRE
> FUSED (Connection refused)
> close(3) = 0
> socket(PF_UNIX, SOCK_STREAM, 0) = 3
> connect(3, {sun_family=AF_UNIX, sun_path="/var/run/utmpd.ro"}, 110) = 0
> That is from a trace of who (from sh-utils 1.16m), it doesn't have any
> invocation of connect or any other socket types call in the source, it
> in fact tries doing a open on /var/run/utmp. So I'm guessing that glibc
> or utmpd somehow catches the open to /var/run/utmp and then directs it to
> the /var/run/utmpd.* files? Why?
That's the result from calling getutent. Read the glibc doku about utmpd.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de