Operating System - HP-UX
1829716 Members
3310 Online
109992 Solutions
New Discussion

commando LAST displays that users still logged in, but they ain´t

 
Erich_1
Advisor

commando LAST displays that users still logged in, but they ain´t

Hello IT´s

the commando last display that user "still logged in" but their is no user realy logged on the machine.
for example: ".... Wed Jul 5 07:33 still logged in"

Can i restart a daemon that resolves that problem ?
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: commando LAST displays that users still logged in, but they ain´t

Shalom

last does not report who is logged in. who does.

last shows successful logins. Its a record of the successful logins from /var/adm/wtmp from oldest to newest.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: commando LAST displays that users still logged in, but they ain´t

I just realized my error, after clicking.

Check the output of last against who. If the user is still in who, then its one solution. If the user is really logged out its something different.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
RAC_1
Honored Contributor

Re: commando LAST displays that users still logged in, but they ain´t

It could be on account of corrupted wtmp file. You can null it out and check. Also you can use fwtmpfix command to correct it.

/usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/xx
There is no substitute to HARDWORK
RAC_1
Honored Contributor

Re: commando LAST displays that users still logged in, but they ain´t

1. convert the binary wtmp file to an ascii file
# /usr/lib/acct/fwtmp < /etc/wtmp > foo

2. edit the ascii file by using vi editor
# vi foo

3. then restore the ascii file into the binary wtmp file
# /usr/lib/acct/fwtmp -ic < foo > /etc/wtmp
There is no substitute to HARDWORK
Erich_1
Advisor

Re: commando LAST displays that users still logged in, but they ain´t

Hi RAC,

i cant find any errors in wtmp.
My Problem is that every user is still logged on an this is a problem for my ERP-System Login.

In the attachmant their is an example from the last-commando (the error begins after a system-reboot !!)
RAC_1
Honored Contributor

Re: commando LAST displays that users still logged in, but they ain´t

ERP system login is dofferent from system login. What we are talkign about is system login. You can use
who -Hu to see current system logins.
last -R to see previous successful logins.
lastb -R to see previous unsuccessful logins.
There is no substitute to HARDWORK
V. Nyga
Honored Contributor

Re: commando LAST displays that users still logged in, but they ain´t

Hi,

this *shouldn't* happen, so I've not yet heard about 'a daemon to resolve that problem'.
I've similar entries in my log - but with 'remshd'.

Maybe HP should search and make a patch for that. The simplest solution you have already got - edit it.

Maybe there's already a patch?

If this remains a problem for you, I believe you have to engage HP in it.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Bill Hassell
Honored Contributor

Re: commando LAST displays that users still logged in, but they ain´t

Actually, this is not an HP-UX problem, it can be caused by problems. One is that your system logs have not been archived in the last year and logins that are more than a year old may be showing up as logins. The other (more likely) problem is that connections have been destroyed by terminals that were simply powered off rather than a normal logout. For PCs and other computers using terminal emulators, these boxes may have crashed or the user simply destroys the window rather than logging out.

The utmp file is where the who command looks and it can become out of sync with reality when these bad connections occur. utmp is simply tracking logins and logouts and knows nothing about whether the user is actually connected. A login entry is recorded and then later, a logout record may be recorded (or not) into wtmp. And since user programs can write to utmp with system calls, utmp can become corrupted. wtmp can be corrupted the same way as it picks up its loging and logout data from the same source as utmp.

Therefore, who and last are only guesses as to active sessions and should not be used as a reliable indicators. If you reboot, all these bad records are cleared and utmp is rebuilt, at which point, the who command will once again be accurate. For last, you would manually use fwtmp (archaic and cryptic as it is) to manually fix the missing logout records. The ps -u command is accurate for 'real' user sessions.


Bill Hassell, sysadmin