The 'last' command doesn't record users logout

The 'last' command doesn't record users logout

Post by Daniel Y.H. Wo » Sat, 11 Dec 1993 21:45:05

It seems that the 'last' command only shows who logged in at what time,
but when the user has logged out, it fail to record it. So the user
once logged in will always recorded as login:

user1    ttyp7        Thu Dec  9 15:25 - 01:13 (still logged in)

user1 logout at 15:30 actually.

What is wrong with it? Where should I start looking?
Also I would like to log the machine that the person is login
from, like:

user2   ttyp2 Tue Dec  7 18:51 - 19:57  (01:05)


Daniel Y.H. Wong                                        UofT:(416)978-1659



1. 'last' command doesn't show complete login times

I am trying to use the information from the "last" command to examine
how long users are logged into a certain machine for a research
project.  I wrote a perl script to parse the information into a comma
delimited file, opened it in a spreadsheet, and sorted the entries by
how long the users were logged in.  To my surprise, out of about 3200
entries, only 17 of them showed up as being logged in for more than an
hour!  I know this information is inaccurate, because these users work
on projects for hours at a time.  Another mystery is that when I run
"who", it shows about 50 users being logged in, whereas the "last"
command only shows about 10.  Running last using utmpx as the file
instead of the default wtmpx, it shows users being logged in for a lot
longer. (???)

I know that the "who" command uses the utmpx file, and the "last"
command uses the wtmpx file, but shouldn't the wtmpx file contain the
same information as the utmpx file, only a lot more of it?  Can anyone
think of an explanation to why the "last" output isn't showing the
entire session a user is logged in for?  Also, if there is data
missing, is there another way I can get the login and logout history
of all the users?

I would greatly appreciate any help you can give. :)


2. linux 1.1.12 and gcc 2.4.5?

3. 'su --login user -c command' doesn't run loggin scripts

4. nslookup command without DNS

5. Help with 'user', 'w', 'who' commands

6. x86 help

7. User's name doesn't disappear after they logout?

8. Why doesn't ISP provide the DNS ?

9. Help: problems with 'w', 'who' and 'last'

10. 'last' doesn't give me latest info

11. Sun's 'last' command

12. last reports 'crash' at logout

13. how to trace users' login and logout records