1834146 Members
3694 Online
110064 Solutions
New Discussion

Corrupt wtmp

 
Paul Thomson_2
Super Advisor

Corrupt wtmp

One of our systems currently has an ongoing issue, when someone logs on it will display they are already logged on despite there being no shell or other processes. We normally run utmp_fix to resolve. Is there any other way we can try and fix this. People log in via hp700/60-70 terminals, This is a D250 hp9000 using v11.
Argh ye land lovers !
4 REPLIES 4
Peter Kloetgen
Esteemed Contributor

Re: Corrupt wtmp

Hi Paul,

yes there is another way to repair the file. If you have a support contract, please call the ITO- support. They designed a tool which they can send to you to fix the problem.


Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Frank Slootweg
Honored Contributor

Re: Corrupt wtmp

You should probably investigate why the problem re-occurs. I.e. apparently some software component is either not updating /etc/utmp or is updating it incorrectly.
Craig Rants
Honored Contributor

Re: Corrupt wtmp

Use these couple of commands and you'll fix your problem.This occurs when who shows a user as logged on but grep is showing nothing. Make sure to note the tty assigned to the Ghost user, this will help you in step 3.

1. cd /usr/lib/acct
2. ./fwtmp < /etc/utmp > /tmp/utmp
3. edit /tmp/utmp changing 5th column to 8 for ghost user
4. ./fwtmp -ic < /tmp/utmp > /etc/utmp

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
federico_3
Honored Contributor

Re: Corrupt wtmp

use the /usr/sbin/acct/fwtmp command in order to read the wtmp file. The form you should use is:

/usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/filetemp

Then you can read the informations (you would have seen with last ) in the file /tmp/filetemp.

Bye