Duplicate pseudo terminals in linux

Posted by bobtheowl2 on Super User See other posts from Super User or by bobtheowl2
Published on 2009-12-29T16:34:02Z Indexed on 2010/04/30 23:08 UTC
Read the original article Hit count: 340

Filed under:
|

On a redhat box [ Red Hat Enterprise Linux AS release 4 (Nahant Update 3) ]

Frequently we notice two people being assigned to the same pseudo terminal. For example:

$who am i
user1 pts/4        Dec 29 08:38 (localhost:13.0)
user2 pts/4        Dec 29 09:43 (199.xxx.xxx.xxx)
$who -m
user1 pts/4        Dec 29 08:38 (localhost:13.0)
user2 pts/4        Dec 29 09:43 (199.xxx.xxx.xxx)
$whoami
user2

This causes problems in a script because "who am i" returns two rows. I know there are differences between the two commands, and obviously we can change the script to fix the problem. But it still bothers me that two users are being returned with the same terminal. We suspect it may be related to dead sessions. Can anyone explain why two (non-unique) pts number are being assigned and/or how that can be prevented in the future?

© Super User or respective owner

Related posts about linux

Related posts about terminal