System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

how to refresh the output of "who" command

 
HPOPSW
Advisor

how to refresh the output of "who" command

On one of the HPUX systems "B.11.23 U ia64" i have this user whose multiple logins show up in who output. Due to restrictions on the system, more logind are not allowed, thereby user gets kicked out when he tries a new session. I have read multiple links in ITRC related to utmp/utmpx and wtmp/wtmpx and as per those, cleared the utmp and utmpx files since the who command accesses those files. Still the who output shows old login entries. Can anyone help ?

Also, i noticed taht using fwtmp, i get proper ASCII output of the utmp file but its not the case with utmpx. The output is not very readable.
/usr/sbin/acct/fwtmp < utmpx >/tmp/newutmpx
4 REPLIES
Horia Chirculescu
Honored Contributor

Re: how to refresh the output of "who" command

Hello,

>cleared the utmp and utmpx files since the who command accesses those



You have nullified the /etc/utmp and /etc/utmpx and you still get the same multiple logins in who output?

Did you do a:

> /etc/utmp

> /etc/utmpx

Both files must be updated (nullified) simultaneously.

This should clear all utmp data.

Horia.
Best regards from Romania,
Horia.
Kapil Jha
Honored Contributor

Re: how to refresh the output of "who" command

although you have nulled the files, they are still open in memory, so you have to restart the process utmpd.
Or this would go after reboot.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Horia Chirculescu
Honored Contributor

Re: how to refresh the output of "who" command

Kapil Jha is right.

First nullify the files then stop/start utmpd:

/sbin/init.d/utmpd stop
/sbin/init.d/utmpd start

Horia.
Best regards from Romania,
Horia.

Re: how to refresh the output of "who" command

>not the case with utmpx. The output is not very readable.
/usr/sbin/acct/fwtmp < utmpx

The -X flag works for utmps(4) but there is no option to work for utmpx(4) format.