Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!lll-crg!lll-lcc!qantel!intelca!oliveb!hplabs!hao!nbires!isis!scicom!markf From: markf@scicom.UUCP (Mark Felton) Newsgroups: net.unix Subject: Timing a person's access on Xenix Message-ID: <332@scicom.UUCP> Date: Tue, 11-Mar-86 17:46:52 EST Article-I.D.: scicom.332 Posted: Tue Mar 11 17:46:52 1986 Date-Received: Sat, 15-Mar-86 19:58:02 EST Organization: Alpha Comm. Dev. Corp., Denver Lines: 39 Re. Timing out a person after a given period on Xenix. Thanks to everyone who sent suggestions. Many of them hinted me in the right direction. I then came up with the following solution. It is so simple it should work for any system. The two lines go into a .profile for the user guest. A shell script which can be placed in /usr/bin or any other appropriate place is activated after the background process times out. This then causes two background tasks to activate. They will give 2 minute and 1 minute warnings then kick you off the system. This assumes several thing which are true for my system. 1) the timeout is just to notify you and that you are working with cooperative users who just forget sometimes how long they have been on the system. The person could call right back. In my case the public is cooperative because they want the information }iI give them, they just forget sometimes. 2) you are not dealing with people that will edit the .profile or kill the processes. If you are you could chown kill and .profile to root. Again, this is not a problem for my system. Thanks again for all the suggestions. I have not yet had a chance to test some of the 'fork' suggestions which may run faster. I will do so in the future, but felt this solution was worth getting back to the net with. # place the following two lines at the end of .profile b=`tty` `a=$$; sleep 3600; disconnect $a $b` & # the number 3600 gives 1 hr. on the system - 60 * 60 second # set this to your requirements # disconnect program # this shell script is activated after the time in .profile # it will then give a two minute and one minute warning echo 'WARNING !! 2 MINUTES TO DISCONNECT' > $2 `sleep 60; echo 'WARNING !! 1 MIN TO DISCONNECT' > $2` & `sleep 120; kill -9 $1` & ------------------> 0 <------------------ ^ "I'll be back" | The Terminator