Operating System - HP-UX
1748286 Members
3860 Online
108761 Solutions
New Discussion юеВ

Re: last returns no login info

 
SOLVED
Go to solution
Michael Sillers
Trusted Contributor

Re: last returns no login info

Here's another copy of wtmp - this time I made sure I transferred in binary.

Our HPUX is 11.11
Dennis Handly
Acclaimed Contributor

Re: last returns no login info

>Here's another copy of wtmp - this time I made sure I transferred in binary.

Much better. It appears there is an initial newline that needs to be removed:
$ dd if=366905.null of=wtmp.fix bs=1 count=908220 skip=1

(Unfortunately this bs=1 makes dd(1) very slow.)

This wtmp.fix seems to give good Jan 18 timestamps.
Michael Sillers
Trusted Contributor

Re: last returns no login info

Thanks all for your help. The dd has fixed it and also helped me locate the problem. A previous administrator had been incorrectly truncating the file using a script called by cron.
Dennis Handly
Acclaimed Contributor

Re: last returns no login info

>incorrectly truncating the file

echo > /var/adm/wtmp
vs:
> /var/adm/wtmp # ?
Michael Sillers
Trusted Contributor

Re: last returns no login info

echo "" > /var/adm/wtmp. Puts a line feed character that last doesn't recognize.