[Techtalk] conflicting results who and w

Meryll Larkin alwanza at oz.net
Mon Dec 8 17:29:58 UTC 2008


 
I always check to see that noone is logged into our lab desktops (RHEL5)
before rebooting them after doing updates.

I wrote a script that checks with the "w" command, but when I check manually
I use "who".

I was confused last night at 3:00am when I saw different results on the same
machine.  Maybe someone can help me make sense of this.  
I am ssh'ing in from my own desktop, "potter". 
"desktop_1" is the computer I'm sshing into.  
"stdnt" is what I'm supposing is the login to other session that is being
reported with "w".  
- thanks, Meryll

Output:

desktop_1:~]$ w
 02:45:09 up 6 days,  8:37,  2 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
meryll   pts/0    potter    02:45    0.00s  0.02s  0.00s w

desktop_1:~]$ who
meryll   pts/0        2008-12-08 02:45 (potter)

[root at desktop_1 ~]# who
meryll   pts/0        2008-12-08 02:45 (potter)

[root at desktop_1 ~]# w
 02:45:25 up 6 days,  8:38,  2 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
meryll   pts/0    potter   02:45    0.00s  0.03s  0.02s sshd: meryll [priv]

[root at desktop_1 ~]# ps aux |grep ssh
root      9846  0.0  0.1   6992  1044 ?        Ss   01:40   0:00
/usr/sbin/sshd
root     10395  0.0  0.3  13312  3552 ?        Ss   02:45   0:00 sshd:
meryll [priv]
meryll   10400  0.0  0.1  13312  2060 ?        S    02:45   0:00 sshd:
meryll at pts/0
root     10479  0.0  0.0   3912   700 pts/0    S+   02:45   0:00 grep ssh
stdnt    17404  0.0  0.0   6484   608 ?        Ss   Dec03   0:00
/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "/usr/bin/dbus-launch
--exit-with-session /etc/X11/xinit/Xclients"




More information about the Techtalk mailing list