/* Copyright (c) 1992 Vincent Cate
 * All Rights Reserved.
 *
 * Permission to use and modify this software and its documentation
 * is hereby granted, provided that both the copyright notice and this
 * permission notice appear in all copies of the software, derivative works
 * or modified versions, and any portions thereof, and that both notices
 * appear in supporting documentation.  This software or any derivate works
 * may not be sold or distributed without prior written approval from
 * Vincent Cate.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND VINCENT CATE DISCLAIMS ALL
 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL
 * VINCENT CATE BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
 * OR PERFORMANCE OF THIS SOFTWARE.
 *
 * Users of this software agree to return to Vincent Cate any improvements
 * or extensions that they make and grant Vincent Cate the rights to
 * redistribute these changes.
 *
 */


     ****  IMPORTANT  ******
1) The Alex server should be run on a machine that does not need to 
   export any other NFS files.  Alex needs both the NFS port and the mount 
   port, so you can not be running either an nfsd or a mountd.  You can 
   get around this if your mount command can take a mount port number
   (not just an NFS port number) or are willing to recompile "mount" with
   a new port number and edit config.nfs.h.  

2) First, make a user called "alexsrvr" with a home directory of 
   "/usr/alexsrvr".  The default shell should bin "/bin/csh".  
   This will simplify installation and updates, as well as make Alex 
   a bit safer. 

3) After making the user "alexsrvr" you can probably run
   "getalex" as root which automates the rest of the installation.
   If it works you don't need to do anything else to start the server.
   You then just run "mountalex" on any other machine you want to also
   use the server (will be run for the server machine automaticaly).


4) If "getalex" failes then, as alexsrvr type the following: 
   (cd /usr/alexsrvr/src; make installbasic)

5) Then as root:
       /usr/alexsrvr/bin/start.alex

       In a couple minutes "ls /alex" should work.  If not, see hints below.
       If yes, do a "cd /alex/edu/cmu/cs/sp/alex/links" and look around.

6) Also you might want to test it by running "~/bin/regression.test"
   (run as alexsrvr).

-----

7)  Can put something like this /etc/rc.local to be run at startup time:

       echo 'Starting Alex server'         >/dev/console
       /usr/alexsrvr/bin/start.alex >> /usr/alexsrvr/boot.log  &

8)  See README.usr for more user related stuff like mounting Alex and 
    nice aliases.

       Talks about stuff in usr.*

9)  Send email to alex-servers-request@cs.cmu.edu to get added to the mailing
    list so you will be notified of problems, updates, etc (very little mail).
    There is also an alex-users mailing list you can get on.

10)  In ~/src do a "make all" and then "make install".

11)  The "evictor" removes things from the cache as needed.  The script 
    "evictor.nanny" runs evictor.  This should be run by "alexsrvr" while
    in ~/bin.  Only needed when cache starts getting full but it is good to
    start it and just have it running at all times.  Note that "start.alex"
    starts this up if it can.

12)  If, far in the future, things were working right but then start to
    get a bit flaky (say "pwd" does not always work), you may want to 
    "runalexfsck".  If that does not work, doing an "rm -rf alex-cache"
    and getting a new version of the code is not too painful.

13) If you make a directory of symbolic links FTPable, please let me know so
    I can make a symlink to it.  If you find some neat places that are not 
    in my set of links, let me know and I will add them.       

14) Since this work is for my thesis the default is for Alex to mail back
    a short message when it starts or exits.  If this is OK please make
    sure that UCBMAILPATH is correct in config.h.  If not just comment
    out that #define.

15) If you find a bug please send a fix.

Vincent Cate
Graduate Student
Carnegie Mellon University
vac@cs.cmu.edu


The starting point for this software was "unfsd" created by Mark Shand.  


PS  When using Alex, "." should come at the end of your search path.
    Also, Alex will seem slow if you have aliased "ls" to something 
    like "ls -F".  


Hints for debugging instalation:
   start.alex may have trouble if the alex-cache and ~/logs directories
   are on a fileserver.  The problem is that in the NFS world just because
   someone is root on one machine does not mean they can "su" to another
   user and access his files on another machine.  Just have those 2 
   directories be symbolic links to someplace on a local disk.

   more /tmp/umound.log  
           to see if alexmountd is getting called and returning a good status
                              
   grep ERROR alex.log.0  
           common problems are permissions wrong on directories or files
           that alexd needs (~/lib, ., alex-cache) 

   ls alex-cache
           if alexd dies and alex.nanny restarts it there will be old.* 
             directories look in one of those at the alex.log.0 to see 
             why it died

   If you can not figure out what is wrong you can send me copies of the logs
   or you can make your logs ftpable, and tell me the hostname of your
   server so that I can mount it.  I will mount it on one machine and use my
   own Alex on another machine to look at your logs as I try things.

**********************************************************************
****             for any problem with "rpcgen"                    ****

Right after expanding alex.tar.Z you should just do the following:

   make norpcgen

This will cause the makefile to realize that these files are ok and
so it will not regenerate them (don't do a make clean).


If user ID is other than "alexsrvr" or home is other than "/usr/alexsrvr"
you should edit Makefile.

You can also do a "make noyacc" if you do not have yacc.

