loggin out automatically

trewornan treworn at cyberspace.org
Mon Nov 11 16:45:15 EST 2002


Kyler Laird wrote:
>>>>I am responsible for maintaining a PC in a hotel which is available for
>>>>use of guests, basically just e-mail and web browsing. We are currently
>>>>using a program called "timewatcher" which allows me to provide "access
>>>>codes" each code providing a particular period of access - 20, 30, 60
>>>>min or whatever
>>>
>>>You could use this script as the default shell for guests; it 
>>>automatically kills bash after a fixed amount of time:
>>
> 
> [good simple Python script]
> 
> 
>>Seconded.  Something like this will probably serve you
>>even better than your current "timewatcher".  I think
>>you'll end up pleasantly surprised at how simple and
>>flexible such operations are under Linux.
> 
> 
> Speaking of flexibility, I suggest that after the time
> has expired, you check a file for a new code.  This
> would allow the user to acquire (buy?  beg?) more time
> and then use it without having to restart everything.
> A setuid script could be used to update the file.
> 
> I'd probably also do something more complex than this:
>     os.kill(pid, signal.SIGTERM)
> Maybe just HUP it first and then TERM/KILL it later?  I
> am thinking it would be good to give it a chance to
> save data.
> 
> You're going to run an X server for all of this, not
> just give users a command shell, right?  You could just
> use a similar script to end it.
> 
> --kyler

Sorry I haven't replied before but i've been away for the weekend and 
only just got back. Thanks for all your help, I think I've got enough of 
an idea now to be able to work towards something.

Once again many thanks,

Mark




More information about the Python-list mailing list