Operating System - HP-UX
1829602 Members
1853 Online
109992 Solutions
New Discussion

yet another utmp question

 
raam narayan
Occasional Advisor

yet another utmp question

HP-UX B.11.23 ia64
Well, I observed utmp file is not getting updated. And whenever a login/logout is happening, the utmpx file is being updated.

who,w commands are working perfect.

my question is that possible utmp not getting updated and "who" working proparly?

in that case from where it is fetching the "idle time"? (who -u)

thanks
9 REPLIES 9
Wouter Jagers
Honored Contributor

Re: yet another utmp question

I think the man page of utmpd might explain:

"utmpd, user accounting database daemon, manages the user accounting database which is the database of currently logged-in users. This was previously maintained by /etc/utmp and /etc/utmpx files on HP-UX."

A bit further, it states:

"utmpd(1M) takes care of synchronizing the legacy /etc/utmpx file and its own in-memory database. The synchronization is bi-directional from the utmpd's database to the /etc/utmpx and from the /etc/utmpx file to utmpd's database. However, this synchronization does not happen in real time. There is a time lag which could span from a few seconds on a lightly loaded system to a few minutes on a heavily loaded system."

Always worth checking manpages.. things change all the time :-)

Cheers
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Kapil Jha
Honored Contributor

Re: yet another utmp question

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1255484395558+28353475&threadId=782839

I think this gonna help you out, please look at previous threads they are pretty useful ;)

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Suraj K Sankari
Honored Contributor

Re: yet another utmp question

Hi,

Read the manpage of command "fwtmp & wtmpfix" which transfer wtmp-like file into ascii format.

Suraj
Dennis Handly
Acclaimed Contributor

Re: yet another utmp question

>is that possible utmp not getting updated and "who" working properly?

As Wouter said, who(1) doesn't use utmp, it talks to utmpd(1M).
Wouter Jagers
Honored Contributor

Re: yet another utmp question

Indeed, the manual page says that you don't need to worry.

It says that nowadays the utmpd daemon keeps the database of currently logged-in users in memory, and the files are "old stuff". That's why everything works fine.

Cheers
an engineer's aim in a discussion is not to persuade, but to clarify.
raam narayan
Occasional Advisor

Re: yet another utmp question

wout,

thankyou for the info on utmpd.

i found in utmpd man that "getuts" should be used for add,update or query the log information.

getuts is having all the values but "last access time". from which, we can be able to calculate the idle time. it is having only entry time field(ut_tv).

any idea on how to fetch the "last access time" to calculate idle time?.

-R
Dennis Handly
Acclaimed Contributor

Re: yet another utmp question

>any idea on how to fetch the "last access time" to calculate idle time?

You created another thread:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1378982
raam narayan
Occasional Advisor

Re: yet another utmp question

Hi Dennis,

Actually i waited for some time for reply in this thread. I thought the thread title is some what not related the question on my mind. So I created another thread.

Sorry for the Inconvenience caused.

raam narayan
Occasional Advisor

Re: yet another utmp question

Closing the thread.