1834925 Members
2420 Online
110071 Solutions
New Discussion

Re: WTMP problems

 
MANOJ SRIVASTAVA
Honored Contributor

WTMP problems

last on the wtmp gives me a core dump is there any way to get the information of the user in such cases ?
6 REPLIES 6
Kofi ARTHIABAH
Honored Contributor

Re: WTMP problems

have you tried

strings wtmp?
nothing wrong with me that a few lines of code cannot fix!
James R. Ferguson
Acclaimed Contributor

Re: WTMP problems

Hi:

You might try 'fwtmp' (see: man 1M fwtmp) to read the file. If the file is corrupt, your only recourse may be to:

# cat /dev/null > /var/adm/wtmp

...JRF...
federico_3
Honored Contributor

Re: WTMP problems

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
CHRIS_ANORUO
Honored Contributor

Re: WTMP problems

If you have finished with federico's command, delete the corrupted file and use touch /var/adm/wtmp to create a new wtmp file.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Vincente Fernandes
Valued Contributor

Re: WTMP problems

Looks like your wtmp file is corrupt use fwtmp to fix it or remove the file and create with a new one.
James R. Ferguson
Acclaimed Contributor

Re: WTMP problems

Hi:

BTW, the safe way to handle recreating the wtmp file, if necessary, is:

# cat /dev/null > /var/adm/wtmp

...JRF...