*BSD News Article 95806


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!rill.news.pipex.net!pipex!oleane!jussieu.fr!fdn.fr!r2d2.fdn.org!sphynx.fdn.fr!causse
From: causse@sphynx.fdn.fr (Philippe Causse)
Subject: Re: Q: Is there something wrong with the 'ac' command
X-Newsreader: TIN [version 1.2 PL2]
Organization: individual - paris - france
Message-ID: <EAHtyq.uE@sphynx.fdn.fr>
References: <337F45E3.7A97@XXsnet.net> <5lpc49$13c@fstgal00.tu-graz.ac.at> <EAFoCH.vu@sphynx.fdn.fr> <5lq7lc$o44@fstgal00.tu-graz.ac.at>
Date: Tue, 20 May 1997 18:56:50 GMT
Lines: 52
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:41295

Martin Kammerhofer (dada@sbox.tu-graz.ac.at) wrote:
: Philippe Causse (causse@sphynx.fdn.fr) wrote:
: : : FreeBSD's ac is buggy. Guess nowadays it's not much used anymore?
: : 
: : Strange... I use it here (FreeBSD-2.1.5 , hand-patched 2.1.6) and it
: : runs perfectly!
: : Note however that connect times are lost each month (when /etc/monthly runs).
: : 
: : Maybe you don't have read permissions on /var/log/wtmp* or the directory
: : /var/log is locked (mode 700)...
: : 
: : In any case, run the /etc/monthly. It should fix the perms.
: : 

: The perms are OK, there is a bug - the times reported are way too small.
This may be a problem of granularity...

: I guess a few minutes with gdb and I would see clearer.
Take a breath and.... good luck !

: About a year ago I wrote a little program that takes a time-spec as command
: line argument and tells you who was logged in at the time. I remember there
: are lots of login records *without* matching logout records in wtmp.
Yes, it happened in FreeBSD-2.0.5 if I remember !
But even 2.1.5 has been fixed...

: E.g. if you type 'login anotheruser' from your login-shell there will be no
: entry in wtmp for logout, just another login record for your line (tty).

Well, I use to work with bourne shell (/bin/sh). 
I tried your experiment and it works as expected. No bugs, ac runs okay.
Maybe your "libutil" has been corrupted...
Maybe the shell you're using is not updating the wtmp properly...

: My program and last(1) know about that but maybe ac(8) doesn't?

Rather strange since last and ac look in the same file (wtmp) !!!

: Probably I'd better look at the sources (or use gdb) rather than making wild
: guesses here...

Try different shells, I suspect there may be a problem with a builtin
login facility!

: Martin

Regards,
Philippe.
-- 
-------------------------------------------------------------------
P. Causse			http://www.fdn.fr/~pcausse
4.4BSD/X11R6/Motif-2.0/C++	mailto:causse@sphynx.fdn.fr (UUCP)