From: sherwood@fenris.space.ualberta.ca (Sherwood Botsford)
Newsgroups: comp.sys.next.sysadmin
Subject: Re: LogoutHook question
Date: 27 Aug 92 18:01:42 GMT
Organization: University Of Alberta, Edmonton Canada

> lemson@ux1.cso.uiuc.edu (David Lemson) writes:
> : I know that if a LoginHook exits with a 0, the login  
proceeds
> : normally.  If it exits with a 1, then the login kicks  
back out to
> : the prompt.
> : I want to do the same sort of thing with LogoutHook.   
If I exit the
> : LogoutHook program with a 1, I want it to dump the user  
back into
> : the workspace, not letting them log out.  I tried it,  
and it doesn't
> : work.  Anyone have any idea how I might do this?  
(something
> : undocumented?)
> : BTW, in case you're wondering why I don't want to let  
the user log
> : out, it's because I want to force them to go back and  
reduce their
> : disk usage before they log out. 
> : -- 


I assume that you have looked at Quotas.tar.Z

Ok, other thoughts.

I have a script, called CleanScratch that checks the atime  
flags for all the files on the Scratch disk.  Any that  
haven't been accessed in 9 days results in mail.  After 11  
days they are removed. 

This action is drastic, but for the Scratch disk (which is  
public writable, and never backed up, ) is suitable.

For your situation, you could work like this:

any directory that hasn't had a file accessed for n days is  
zipped.

If a zipped file is not accessed for M days, a request goes  
to the user to move it to tape.

Another idea:
	All users are normally members of group GoodUsers
	Each night run quot on the user file systems.  For  
those users above n Megs, remove them from membership of  
GoodUsers.
	Now go through an make most of the apps owned by  
GoodUsers and take off the execute by other bit.  (You  
could even take it off the directory.  This would result in  
most of their dock being question marks.
	Mail is left functional.
	They are sent mail explaining the problem, along  
with the output of du on their files. 

	I think you could modify Quotas to work with this,  
so that when they got within 20% of quota max they would  
get a warning, and when the quota was exceeded, instead of  
being locked out, they just could access the workspace and  
Mail and Stuart.

Yet another idea.
	Since Quotas keeps track of how much users have  
been using, you could institute billing.
	An account costs $25/Semester.  Your account is  
debited 2 cents per Megabyte-day, and 5 cents per copy  
printed.  No charge for actual console use.
	(This generates $7/meg/year which would more than  
pay for a new disk even if you sold only half the space)
	LoginHook tells users what their current status is.

	To make administration easy, additional funds are  
purchased only in fixed units (Say $10 bucks)

	If you have a hoard of such users, what I'd do is  
print up cards with an encrypted string on it.  Write a  
program called AddAccount that is called by LoginHook when  
the users account is overdrawn.  The panel for AddAccount  
floats on top of everything, and covers the entire screen.   
On this window it gives the current account info.  It has a  
single window for the user to punch in the encrypted  
string.  When the string is entered, the users account is  
updated.   AddAccount asks if the user wants to log in any  
more funds.  The user can log in as many strings as he has.  

	Each string is unique, and is used only once. You  
need a protected database for that.

	Now you print up a bunch of cards with these  
strings on them, put them in non-see through envelopes (Or  
have the mainframe print them on the same kind of stomp  
through envelope they use for sending out grade  
information.)

	The bookstore sells these things.  

	Beauty of this:
	You don't have to have a staff person who has to  
take peoples money.  You don't have to have an operator to  
punch the things in.  Money is collected by the bookstore  
who is good at that.  Entry is done by the user himself.