Operating System - HP-UX
1820390 Members
3674 Online
109623 Solutions
New Discussion юеВ

last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

 
Andrey Zhelnin
Occasional Advisor

last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Hello!
HP-UX 11.23.
My last show only ftp logins, but in wtmp I saw
other logins.
cat /dev/null > /var/adm/wtmp
and
cat /dev/null > /var/adm/wtmps
not fix it - whith new files last work just as before.
Please, help me!
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Shalom

> /var/adm/wtmp
> /var/adm/wtmps

This will empty them but leave them in place with permissions.

inetd -l should start enhanced logging.

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

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Hello,

This thread should help you.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=990722

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
RAC_1
Honored Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

There is fwtmpfix and fwtmp command.
Did you use it??
There is no substitute to HARDWORK
Andrey Zhelnin
Occasional Advisor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Thank you all,
but not for a while yet nothing help me:((

to Steven E Protter -
I clear both files, how You write -
> /var/adm/wtmp
> /var/adm/wtmps
and they will be zero size. Then, when users login, situation was repeat -
1) in wtmps - only ftp logins
2) in wtmp - other logins
but last command show only logins from wtmps!
lastb work properly.

to Arunvijai
- I alredy read this thread, but main idea of it - properly clear wtmp, I do it, but nothing changes...

to RAC
I don't understood, how work whith this command :((
/usr/sbin/acct/wtmpfix < /var/adm/wtmp
Invalid input. Exiting ...
Arunvijai_4
Honored Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Hello,

/usr/sbin/acct/wtmpfix < /var/adm/wtmp
works for me.. # man wtmpfix will help you.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Devender Khatana
Honored Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Hi,

You should truncate both "/var/adm/wtmps" & "/var/adm/btmps" files (AND NOT /var/adm/wtmp & /var/adm/btmp ) as your OS is 11.23 and not 11 or 11i.

These has been the small chages in OS revisions which we always forget at times.

HTH,
Devender
Impossible itself mentions "I m possible"
Andrey Zhelnin
Occasional Advisor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Last not work, but
/usr/sbin/acct/fwtmp < /var/adm/wtmp
show me all logins not ftp.
Because I don't know, how do last work properly, I'll use
/usr/sbin/acct/fwtmp < /var/adm/wtmp

But I hope, may be anybody know, how do this?..

Thank You all,

Vera.
P.S. I very bad know english - understand, when I read, but not speak and very bad write, sorry.
VAS_1
Frequent Advisor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Does this command give you the output you expect?

last -f /var/adm/wtmp

What is being used to log in to the machine (ssh, telnet?)

VAS
Geoff Wild
Honored Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Do you have a /etc/utmp ?

Maybe that is corrupt as well....

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Andrey Zhelnin
Occasional Advisor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

Thank you all!

/etc/utmp - is not corrupt,
last -f /etc/utmp
is work properly.

and
last -R -f /var/adm/wtmp
is work properly.

Now, I don't understand only why "last" without arguments not show information from all this files...
Muthukumar_5
Honored Contributor

Re: last doesn't work, and cat /dev/null > /var/adm/wtmp not fix this problem!

last command will use /var/adm/wtmp contents if you did not give -f option.

Can you try as,

mv /var/adm/wtmp /var/adm/wtmp.old

Post this output,

last
last -f /var/adm/wtmp

--
Muthu
Easy to suggest when don't know about the problem!