how to logout someone after a period of inactivity 2 : SUMMARY

From: Bendriss Elmehdi <e.bendriss_at_menara.ma>
Date: Fri Apr 11 2003 - 12:52:51 EDT
hi
some one asked me to summarize :
many told me to put an : export TMOUT=xx (xx in seconds) in /etc/profile :
usefull above all when users use xterm
many others recommend the "autologout" environment variable (csh) that do the
same thing, but users may avoid it by putting something like : unset
autologout in their own profile file
some one sent me a link : http://access1.sun.com/codesamples/kstat.html
there's a source code to get mouse and keyboard idle time : doesn't suite me
because my users connect using telnet/ssh
Beavers, Reginald sent me this shell code that i haven't try yet : as he said
: logicaly it should do the job:
###################################################
#!/bin/sh

# egrep those who are immune

who -u | egrep -v 'root|me' |while read line; do

pid=`echo $line | awk '{print $7}'`
idle=`echo $line | awk '{print $6}' | awk -F: '{print $2}'`

if [ $idle >= 10 ];
kill -9 $pid
fi

done
#####################################################"

and finaly, the C source code that John Adams sent me; i attached it to to me
email.
that's it.
thank you all for your help
Cordialement/ Best Regards
BENDRISS Elmehdi
Administrateur Systhme
Tel : +212 37 71 88 73

[demime 0.99c.7 removed an attachment of type application/octet-stream which had a name of autologout.c]
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Apr 11 12:56:26 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:08 EST