Operating System - HP-UX
1847410 Members
3213 Online
110264 Solutions
New Discussion

"last" command dumps core - HP-UX 11.00

 
SOLVED
Go to solution

"last" command dumps core - HP-UX 11.00

How do I fix this problem?!

# whoami
root

# uname -a
HP-UX pokie B.11.00 U 9000/800 1514750538 unlimited-user license

# last
Memory fault(coredump)

# file core
core: core file from 'last' - received SIGSEGV

7 REPLIES 7
harry d brown jr
Honored Contributor

Re: "last" command dumps core - HP-UX 11.00

If it used to work, and now it is failing then either your btmp or wtmp file is corrupt.
Live Free or Die
James R. Ferguson
Acclaimed Contributor
Solution

Re: "last" command dumps core - HP-UX 11.00

Hi Brian:

This should fix your problem:

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

Regards!

...JRF...

Re: "last" command dumps core - HP-UX 11.00

Hi Harry,

I have both files:

# ls -altr /var/adm/btmp
-rw------- 1 root other 4500 Oct 18 13:12 /var/adm/btmp
# ls -altr /var/adm/wtmp
-rw-rw-r-- 1 adm adm 161336 Oct 18 13:59 /var/adm/wtmp

How do I tell which is corrupted?

Thanks,
/ Brian

linuxfan
Honored Contributor

Re: "last" command dumps core - HP-UX 11.00

Hi Brian,


last command gets its information from wtmp file where as lastb gets it from btmp.

In your case looks like wtmp is corrupted.

you could try "cat /dev/null > /var/adm/wtmp"

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates

Re: "last" command dumps core - HP-UX 11.00

Yes, "last" was working before and then mysteriously stopped. I *think* it was after I used sam to change some kernel parameters (maxdsiz, etc.) that it stopped working.

But the "cat /dev/null > /var/adm/wtmp" command fixed this problem. Thanks.
James R. Ferguson
Acclaimed Contributor

Re: "last" command dumps core - HP-UX 11.00

Hi Brian:

One more trick. If you ever need/want to preserve your 'wtmp' and/or 'btmp' file, but it is corrupted, or you simply want to trim it, then you can "edit" it like this:

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

At this point, you may edit the /tmp/wtmp file, since it is a ASCII file.

# /usr/sbin/acct/fwtmp -ic < /tmp/wtmp > /var/adm/wtmp

Regards!

...JRF...
Roger Baptiste
Honored Contributor

Re: "last" command dumps core - HP-UX 11.00

Brian,

You can use /usr/sbin/acct/wtmpfix command
to try fixing the corrupt
wtmp file. If it doesn't
work you can preserve
the ascii version of the file
by running fwtmp .

-raj
Take it easy.