Timing a person's access on Xenix

Mark Felton markf at scicom.UUCP
Wed Mar 12 08:46:52 AEST 1986


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



More information about the Comp.unix mailing list