Re: Timeout for lazy users - Help Needed
Posted in 1998
Rajesh_Kapur@spartanstores.com wrote: > > We are trying to implement some method that will log off users from the > system after 2 hours of inactivity. We started by looking at the > environment variable TMOUT. This works fine for users will AIX prompt but > not for users who are taken straight to a menu of the application. We have > written a shell script that finds the PID from 'who -u', compares the > inactive time and does a kill -1 on the PID, if old. This has worked well > in our initial tests and has gracefully terminated user processes and the > Informix threads as well. Our current environment(s) -->RS-6000, (AIX 3.2, > Informix 5.05 UC1) & (AIX 4.3, Informix 7.24 UC1). > > Questions: > > - Can 'kill -1' fail some of the times? > - Do we need to graduate to 'kill -6' or 'kill -9' if 'kill -1' fails? > - Can this kind of killing the user processes leave orphans behind? > - Does anyone have/know of some standard shell scripts etc. that will > gracefully exit the lazy users? > > Thanks for your help in advance. Some Unixes come with a facility to do this already. SCO does. It's called IDLEOUT. All it does is send a signal to processes, so you still need to address the issues Jonathan describes. If the signal it sends is not the one you want, you would be better off writing your own code. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions AND the release notes. All opinions are my own and not those of Bayer plc. My Internet plumbing does not allow me to mail and post news together. Sorry. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/