
		G R  -  A   G A M E   R E G U L A T O R

			   for Berkeley UNIX

			      Release 2.0
			     January, 1987


GR is used to regulate game playing.  It checks various system facts
to determine if game playing is allowed.  GR can be set up to not
allow game playing:

	1) during certain hours (i.e. prime time work hours), 
	2) when the load average exceeds a set maximum, 
	3) the number of users exceeds a set maximum, 
	4) if there are not enough free "special" tty lines 
	   (i.e. dialup lines), and 
	5) if a master no-game-playing file is present.  

All configuration parameters can be specified in a central control
file that is read on the fly.  Please read the manual pages (gr.8 and
gr.conf.5) for specific details.
	
GR is based on "gsh" written at Reed College by a person who wishes to
remain anonymous.  Little of the original code remains, however.

We have been running GR on VAX 11/750's (under both 4.2 and 4.3 BSD)
for almost a year now without any major problems.  It is very useful
for keeping people from abusing the system with games during heavy
usage times when ``real'' work is being done.

Since its last release via mod.sources in May of 1986, there have been
several key bug fixes.  The most important of which, was a problem
with setuid games not being nuked off as advertised.  I have also
moved almost all configuration parameters to the master control file.
You should no longer need to edit gr.h.  See the code for details on
the changes that have been made.

Throughout the code you may notice #ifdef FINDTTY's.  This is there
for finding a user's real tty by looking at there process tree.  It
was written for 4.2BSD, but is not needed for 4.3BSD since the
ttyname() call now handles things properly.  You should not really
need the code if you are still running 4.2BSD.  Indeed, the version of
GR posted in mod.sources did not have the code and things seemed to
work okay without it.  If you *really* want to use it, please contact
me and I will send you an additional C file containing the findtty()
function itself.



			How To Install GR


To install GR: 
	1) First read the manual pages, gr.conf.5 and gr.8.  They
	   contain specific information on how GR works and how it 
	   should be configured.
	2) Edit Makefile to reflect how you wish to install GR.
	   You will need to decide what user id GR will run as.
	   I *strongly* suggest using "daemon" since all of the
	   setuid games distributed with 4.[23]BSD run as "daemon".
	   Unless GR is run as "daemon", it will not be able to kill
	   off these setuid games.  The only other alternative is 
	   making it setuid "root", but I strongly advise against this.
	   If /dev/kmem is not readable by the world, but is readable
	   by a particular group (4.3BSD uses group "kmem"), then set
	   the group GR will run as to this group.
	3) Edit the provided "gr.conf" file to customize for your site.
	4) Type "make gr" to compile GR.
	5) Type "make create" to create the appropriate directory and
	   files.  Do this only *once*!
	6) Run "make dolink" to have the games listed in Makefile
	   put under control of the GR.





If you encounter any problems, please let me know.  I'm interested in
hearing about your successes and failures with GR.  If you find a bug
and fix it, please send a context diff along with a note explaining
the problem and your fix.


Michael A. Cooper, University Computing Services, U of Southern California
  UUCP: {sdcrdcf, uscvax}!oberon!mcooper  BITNET: mcooper@uscvaxq
  ARPA: mcooper@oberon.USC.EDU            PHONE: (213) 743-3462
