time limits for users?
I would like to be able to assign per user time limits for dial up users.
eg user X can use the system for 1 hour a day.
Currently I do this with a perl script that replaces /bin/login.
1. forks and executes /bin/login
2. uses $login to obtain user's identity. Repeat until user has logged in.
3. accesses postgresql database to find and update the users time limits.
4. if time has expired kill all process with kill('HUP',-$$), and then
kill('TERM',-$$) after 5 seconds.
5. Go back to 3. This allows updating the time restrictions while the
user is still online.
However, sometime something happened to perl to break this, at step 2
(the step I never really liked anyway). Previously the value of $login
would change when the user logged in, but now it remains static and
I was wondering if it would be better to use PAM for this application?
If so, how should I go about logging the user off after the time has
Also I was considering using the openldap database for this instead of
postgresql, but not too sure about this. Nor am I really sure of what
should happen if the user logs in multiple times...
Brian May <firstname.lastname@example.org>