LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Understanding Idle/Inactive sessions and whether or not someone is logged in (https://www.linuxquestions.org/questions/linux-newbie-8/understanding-idle-inactive-sessions-and-whether-or-not-someone-is-logged-in-854370/)

migee 01-05-2011 09:06 AM

Understanding Idle/Inactive sessions and whether or not someone is logged in
 
Hi Everyone,

I'm trying to understand if anyone is left on a server. Basically I manage a simple linux server remotely used by 3-4 individuals. I can never tell if someone is actually on or not using w/who.

What I'm seeing is some people having what appears to be inactive/lost VNC sessions. I don't understand idle fully, but I do believe a program (without user interaction) can clear idle back to 0, correct?

Anyway, I'm asking because every now and then I need to reboot the server, and I do not want to interrupt any program working on calculations or waiting on having the data saved.

Here's what I see in w:

Code:

me@matrix:~> w
 06:59:54 up 170 days,  9:13, 16 users,  load average: 0.52, 0.16, 0.06
USER    TTY        LOGIN@  IDLE  JCPU  PCPU WHAT
me :2/matri  06:59  ?xdm?  7days  0.10s /bin/sh /usr/X11R6/bin/kde
user1 pts/0    21Dec10 15days  0.00s  1.44s kded [kdeinit]
user3  pts/1    29Oct10 10:42m  0.31s  0.20s ssh -Y aaa@bbb.cccccc.ca
user2  pts/2    27Nov10 39days  0.00s 24.94s kded [kdeinit]
user3  pts/4    20Jul10 169days  0.00s  1:36  kded [kdeinit]
user1 :0        21Dec10 ?xdm?  7days  0.09s /bin/sh /usr/X11R6/bin/kde
user2  matrix.w  27Nov10  0.00s  0.00s  0.06s /bin/sh /usr/X11R6/bin/kde
me pts/5    06:59    0.00s  0.08s  0.01s w
me matrix.w  06:59    0.00s  0.00s  0.10s /bin/sh /usr/X11R6/bin/kde
user3  pts/12    14Dec10 10:30m  0.10s  0.01s ssh ccc.aaa.ca -l rpd2
me pts/3    06:59  46.00s  0.00s  1.36s kded [kdeinit]
me@matrix:~>

Where can I go from here? How can I tell what users I can log off? How can I tell that there has been no user interaction for a week for example?

honeybadger 01-05-2011 01:14 PM

There is a 'wall' command that can be run as a root and the message you type can be delivered to all terminals.
As far as running processes is concerned I ahve found 'ps' most useful. If you know the username of the people you think have logged in then 'ps -u'. You can also look at the passwd file and look at the uid and gid and look it up on ps. Try 'man ps' for more info.
Hope this helps.


All times are GMT -5. The time now is 02:38 PM.