On Sunday 19 February 2006 15:57, Mary Keefe wrote:
> Hello,
>
> I just found out I need to write a script to kill users who have been idle
> for 20 mintues within an application that accesses client data.

First:
What is the application written in?
Do you control the source to the application?
Through what mechanism does the application run? (X11? X11 over SSH? 
terminal?)

For most things, there's no good way to get the time.  If you have access to 
the source code, that's the best place, by far, to put idle-time policy.

It's easy to get the length that a process has been running 
(from /proc/<pid>/{stat,status}), and I wrote a python snippet to do that, 
but I don't think it'll give you what you're looking for.

There could be some hope if it's a terminal-based app - you could check the 
idle time of the terminal itself - and maybe 'write' the term stating that 
the client was disconnected because of idle.

If there's no way to get this information from the application, it should be 
communicated to the non-super-technical folk that want this that it is very, 
very, very, nontrivial to do outside of the application (heck, this is a good 
example of why the source should be available in the first place).

Dave Carlson