[K12OSN] root script query

Martin Woolley sysadmin at handsworth.bham.sch.uk
Thu Aug 11 08:35:54 UTC 2005


On Wednesday 10 August 2005 13:20, Mike Heins wrote:
> Quoting Alan A Hodson (ahodson at elp.rr.com):
> > Gretings
> >
> > To help control senior moments and distracted local users, how
> > difficult would it be to develop a script that logs root out of the
> > system after say three hours of inactivity? I imagine many processes
> > run as root, but if keyboard activity can be isolated, maybe the
> > script can monitor that and just log out, no?
>
> xscreensaver in screen lock mode is the usual method. It doesn't log you
> out, but it protects you from people coming in and having their way with
> your system.
>
> Bash and tcsh both have an Autologout parameter, but I don't think
> you can measure things right with regard to X. Obviously if you were
> running on a shell-based console you could use that.

TMOUT is the way to go here

> Perhaps someone knows a way to get xscreensaver to log you out after
> a longer period of time (i.e. like turning off the display).

I think one way to do this would be to write a C program which grabs the 
postion of the mouse cursor, goes to sleep for a specified time and then 
grabs the position again.  If it hasn't moved, assume the user is inactive 
and log them off.  Tracking the position of the mouse cursor is easy (I have 
written a C program that does this).  Sleeping is a bit more tricky but 
possible.  What I don't know, is how to logoff the user.  Also, I don't know 
how a screen saver affects the position of the mouse.

Another solution is to look at logmon available at http://computronics.com/
I intend to implement this when I have some time.

I think 3 hours of inactivity is way to long.  I reckon 15 mins to be more 
acceptable.  If you are sitting at a vdu you should be using it.
-- 
Regards
Martin Woolley
ICT Support
Handsworth Grammar School
Isis Astarte Diana Hecate Demeter Kali Inanna


*************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity 
to whom they are addressed. If you have received this email 
in error please notify postmaster at bgfl.org

The views expressed within this email are those of the 
individual, and not necessarily those of the organisation
*************************************************************




More information about the K12OSN mailing list