
		Tony Bible
		104 Computer Science
		Iowa State University
		Ames, IA  50011
		515-294-5659


The system portion of ISUQUOTA consists of:
	ISULOGIN  - enters users into the system at login time.
	ISULOGOUT - performs ISUQUOTA logout functions.
	ISUMONITR - performs asynchronous ISUQUOTA functions and
		    enforces connect time quota.
	ISUPRTSMB - enforces print quotas.

The system programs are created as follows:
	1. Invoke CREATOR.COM.
	   This command file will create PUBQUO, the public ISUQUOTA
	   directory SYS$SYSDEVICE:[ISUQUOTA]; create and install the shared
	   accounting routine in SYS$SHARE; create ISULOGIN, ISULOGOUT, and
	   ISUMONITR, and store the executable images in PUBQUO; copy the
	   operational command files into PUBQUO.

	2. Add the following command to your local startup command file:
		$ @SYS$SYSDEVICE:[ISUQUOTA]QUOSTART

	3. Initialize print queues with ISUPRTSMB if print quotas are to
	   be enforced.  For example:
		$ INITIALIZE /QUEUE /PROC=ISUPRTSMB /FLAG /BURST   LPA0


Notes:
	1. All the object, list, and executable files created by CREATOR.COM
	   are stored in sub-directory [.WORK].

	2. All the source files used in ISULOGIN, ISULOGOUT, and ISUMONITR
	   are stored in [.SRCE].  The source files for ISUPRTSMB are in the
	   text library in [.PRTSMB].

	3. The rate table in the accounting routine - ISUACCTG - contains all
	   zeroes.  ISU does not perform cost accounting on VAX at the time
	   this is being written.  If you wish to remove references to
	   ISUACCTG check the cross-reference list for ISULOGOUT and
	   ISUMONITR, and remove the INSTALL command in QUOSTART.COM
	   which is in PUBQUO.


ISULOGIN:
	This program is run at login time from the System login command
procedure.  Its major functions are:

	1. Sets process termination mailbox to ISUMONMBX
	2. Notifies ISUMONITR the user has logged in
	3. Verifies login time lies within authorization/expiration dates,
	   and resource usage is within quota.
	4. Defines three logout symbols - LOGOUT, DECLOGOUT, and ZIPLOGOUT

If the disk usage exceeds quota for an interactive process a sub-process is
spawned, and the user is given the opportunity to delete files using a sub-set
of DCL.  Actually the user can do more than the limited DCL command by using
foreign commands, but we do not advertise the fact, and it is cumbersome to
do.
	If all ISULOGIN tests are passed the program terminates with a login
message.  If the cumulative print quota is exceeded the user receives a
message, but login completes normally.  If a test fails, however, the user
receives messages stating the reason login failed, and the process is
terminated through ISULOGOUT.  Warning messages are displayed when login date
is within two days of the expiration date or resource usage is within 90% of
quota.

ISULOGOUT:
	Users may elect to run this program to terminate their process by
using the LOGOUT command.  The global symbol defined by ISULOGIN will cause
the ISULOGOUT command file to be invoked.  ISULOGOUT's main functions are:

	1. Purge file in the login default directory structure
	2. Perform accounting, write accounting log record, and update
	   the QUAX record
	3. Notify ISUMONITR the logout functions for the process have been
	   performed by ISULOGOUT

The program terminates by deleting the process.  Therefore, there are no
VMS logout messages displayed.

ISUMONITR:
	The monitor is a detached process created at system start-up time.
Its main functions are:

	1. Enforce connect time quotas
	2. Perform logout functions for processes which do not terminate
	   through ISULOGOUT

The monitor is driven by a task queue.  When the task queue is empty the
process hibernates until activated by a task arrival.  The main tasks are:

	1. login -	ISULOGIN sends process data to the monitor's mailbox;
			process data saved on process queue, and terminal
			connect time quota and concurrent session count are
			written to ISULOGIN mailbox.
	2. logout -	ISULOGOUT sends logout confirmation to monitor's
			mailbox; process queue entry marked as logged out.
	3. delproc -	$DELPROC sends termination message to monitor's
			mailbox; if process was marked logged out the entry
			is deleted; otherwise, accounting is performed, and
			a deferred logout job is queued.
	4. timer -	every 30 seconds the monitor runs down the process
			queue and decrements the connect time quota. When it
			reaches zero a warning message is broadcast to the
			user, and an extension is given.  When the extension
			expires a message is broadcast to the user, and the
			process is deleted.


GENERAL INFORMATION:

	ISUQUOTA functions are selectively enabled by setting bits in the
QMASK which is part of the user's QUAX record.  Typically, non-system users
have all bits set, and system users have all bits clear.  Some functions
are not enabled for batch jobs, e.g., logout purge.  Files are only purged
when an interactive process terminates.  This feature is effected by a using
a mask in ISULOGIN/ISULOGOUT to clear bits in QMASK before using it.  There
is also a global reprieve mask which is used after all the login functions
have been performed, but before the messages are displayed.  This mask is
used to clear out the delinquent status bits in the status mask.  It enables
you to perform all the login testing without actually enforcing some (all)
of the quotas.  It was used during development, but could be used to disable
some of the quotas without having to alter all the QUAX records.

	Connect time quotas are only enforced for interactive processes.  The
connect time for each terminal is kept in a file, TTCONN.DAT, which is created
by the monitor from TTINFO.  When a user logs in at a terminal for the first
time, the username and initial connect quota are stored in TTCONN.DAT.  When
the user logs out the connect time quota in TTCONN.DAT is reduced by the
amount of real time the process was connected.  If the user logs in again at
the same terminal he gets the connect quota from TTCONN.DAT, not his initial
quota from QUAX.  If a user uses up his entire connect quota on a particular
terminal, he can not login on that terminal again until
	1. four hours after his inital login or
	2. after somone else has used the terminal.
The objective is to keep "Iron-drawers McGillicutty" from hogging a terminal
during heavy usage periods.  If there are plenty of terminals available (low
demand periods) the user can continue by moving to another terminal.  There
are two exceptions:
	1. Users on dial-up ports get their full quota every time they log in.
	2. Terminals marked PRIVATE in TTINFO do not have the connect time
	   quota enforced.


	Most terminals at ISU come through the locally developed Com Switch,
and are designated TPxx devices by VAX.  The terminal may be assigned different
TP device designations for different logins.  A user system service routine
was developed to provide the Com Switch port id for a current TP device
designation.  (A stub - USS.MAR - has been provided to satisfy the external
reference.)  ISULOGIN writes an accounting log message with the terminal
port id and location information obtained from TTINFO.  The format of the
TTINFO record is described in the TTINFDEF macro in ISUQUOMAC.MLB.  A
program to create TTINFO is in the [.SRCE] sub-directory.


	The process information maintained by ISUMONITR is kept in two queues.
The user queue contains global information about the user, e.g., number of
current processes for this username, and pointers to the queue containing
process specific information.  The process queue contains the process specific
data, e.g., PID.
