On Thu, 28 Jun 2007 16:27:31 -0600 Frank Cox <[EMAIL PROTECTED]> wrote:
> On Thu, 28 Jun 2007 12:42:41 +0200 > Rudolf Rittmann <[EMAIL PROTECTED]> wrote: > > > Which means that we need to limit the time these guys spend on a > > workstation to maximum 1 hour per day, they should not be able to > > login again for that day, inactivity logout, say after 10 min, etc > > As you say, I don't think there is an off-the-shelf solution for this, > but it sounds like a nifty little project. > > As a start, I think something like "sleep 60m && logout" inserted in > one of the login scripts would give you the big boot-out-the-door > after an hour online. > > You would have to log and total the time online and use something to > re-write the 60 to less as the day went by. > > As it's a school you will have to go out of your way to make it > especially bulletproof, but I don't see any reason why it can't > be done. > Not that I can help you any with the scripting, but this post gave me some ideas about the flow. Maybe this will help others out. Basic Idea: User is give XX hours "allowance" for the month. (say with your request earlier, 30 days x 1 hour each = 30 hours). Using the idea above, user can get on for 60min at a time, then kicked off. BUT they can then get back on. (that is where my idea kind of breaks down from your original post) 1) When USER_X logs in, time gets recorded in /tmp/USER_X-on (make sure user does not have write access to this file) 2) At log off, total time is calculated. If user waited to be kicked, then of course this time would be 60 min. So part of the "sleep" line above you can just have it assume 60 mins, without doing the math. 3) Total time used recorded in /root/USER_X-used (or some other secure place) 4) At the beginning of the script, you could have an IF/THEN that checks the /root/USER_X-used file. If it is less then the allowance, then X is started with the default .xsession If it is greater-then or equal to, then X is started with your own special .xsession file that posts a message about time used up already. (xsession is assuming X only logins, you may want/need to use a different startup script) I know this is not exactly what you wanted, but I think it should be a bit easier to script up. The idea of including a limit of 1 hour PER day I think would add a large bit of complexity to the script(s). -- http://gentgeen.homelinux.org ############################################################# Associate yourself with men of good quality if you esteem your own reputation; for 'tis better to be alone then in bad company. - George Washington, Rules of Civility ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _____________________________________________________________________ Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: https://lists.sourceforge.net/lists/listinfo/ltsp-discuss For additional LTSP help, try #ltsp channel on irc.freenode.net
