1833251 Members
3009 Online
110051 Solutions
New Discussion

who issue

 
SOLVED
Go to solution
Carl Munnelly
Frequent Advisor

who issue

I have a user who has logged off but upon attempting to log back in getting told already logged on.

I can't increase number of sessiona allowed (security reason).

User appears in who but has no processes or tty assigned
see output
node> who|grep user
user ttyp2 Aug 24 10:12
node>ps -ef|grep ttyp2
root 18398 18272 1 13:39:15 ttyp1 0:00 grep ttyp2



6 REPLIES 6
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: who issue

Hi Carl,

I'm wondering if this can be caused by a corrupt utmp file.

Europe
http://www8.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00996326-2

US
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en&docId=emr_na-c00996326-2

Title: finger(1), who(1), w(1) wrong output due to corrupted /etc/utmp or /etc/utmpx file
Document ID: emr_na-c00996326-2

Regards,
Robert-Jan
A. Clay Stephenson
Acclaimed Contributor

Re: who issue

You really need to rethink your design because the who command should really be thought of as a "best guess" by the system --- and this is not unique to HP-UX but applies to all flavors of UNIX. The much more reliable method of doing what you are trying to do is to examine the process table (ps).
If it ain't broke, I can fix that.
Carl Munnelly
Frequent Advisor

Re: who issue

It is due to utmp issue, sorry it was that long since last dealt with this I couldn't remember the file I need to check
A. Clay Stephenson
Acclaimed Contributor

Re: who issue

Of course it was a utmp or wtmp issue; that's the nature of the beast and the problem is going to re-occur. Again, these mechanisms should be thought of as "best guess" rather than who is actually on the system.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: who issue

> I have a user who has logged off but upon attempting to log back in getting told already logged on.

The code that is determining the user is logged on needs a rewrite. In other words, don't use the who command. If you want to accurately see what a user is running, use ps -u. You may need to refine the search because ps -u finds every process (cron, at, batch, etc) that is owned by the named user. If you assume that who is wrong, you will not be disappointed.


Bill Hassell, sysadmin
Carl Munnelly
Frequent Advisor

Re: who issue

I am aware of issue but am restricted by business practises. I would ordinarily use the ps method but that isn't company policy and I have to work within them.
I couldn't remember the system file that I needed to investigate.