Configuring your AFS environment
Because many PSC machines share the AFS file system, it is necessary to configure your AFS space to correctly handle the different system types. Of most importance is the need to set up login files (.login and .chsrc files for the C-Shell or .login and .profile files for the Bourne Shell) for many different machines. This document will walk you through setting up the C-Shell for use with AFS and multiple machines. (If you would like to use the Bourne Shell instead, substitute a .profile file everywhere the .cshrc file is noted.)
Setting up multiple login files
As you might imagine, there can be some complications when using a shared file system like AFS. One such complication is the need to set up different login files for many machines and store them in one location. For instance, if you had a login on a machine that had a local disk, you would have a .login file exclusively for that machine. In AFS, however, you need a .login file for many machines and all the machines expect the login files to be in the same location (.login, in your home directory).
There is a surprisingly simple way around this problem. There is a special variable used by AFS, called @sys (pronounced "at sys"). This variable contains the system type of the machine you are logged in to. Here is a list of some of the system types in use at the PSC:
@sys type machine --------- -------- amd64_linux26 pscuxa (Linux front end)
To check the system type of a machine enter the command "fs sysname" while logged onto the particular machine.
We can utilize the @sys variable in a directory structure so that each machine has its very own set of login files. The steps below will show you how to set up logins for the Ultrix front-end.
Creating a login directory structure
-
Create a directory under which all the login files for each particular
system type will be stored. (It is suggested that you follow these
instructions explicitly to avoid problems.)
Enter the following commands from a machine in which your login directory is in AFS, pscuxa.psc.edu.
cd mkdir logins
The first command (cd) will place you back into your login directory. The second (mkdir logins) will create a subdirectory of your login directory called "logins". -
Next, you must create directories for each of the architectures that
you want logins for. To do this :
mkdir logins/alpha_dux40 mkdir logins/ymp_uni90
Now enter the command: "ls -l logins". You should see something similar to the following:pscuxa.psc.edu% ls -l logins total 6 drwxr-x--- 2 joeuser 2048 Jul 25 12:33 alpha_dux40 drwxr-x--- 2 joeuser 2048 Jul 25 12:33 ymp_uni90/
Placing login files in the proper location
-
Now that we have the directories created, we need to put login files
for each system type in the directories. The links below supply a
.login and .cshrc file for each machine we are working with. You can
use the files located there or your own.
- DIGITAL UNIX front end
-
Now copy the .login file for the DIGITAL UNIX front-end into the
logins/alpha_dux40 directory. (This example assumes you have
stored the DIGITAL UNIX .login file in your AFS login directory and named it
"dunix_login.txt").
cd cp dunix_login.txt logins/alpha_dux40/.login
-
Next copy the .cshrc file for DIGITAL UNIX into the same location.
cp dunix_cshrc.txt logins/alpha_dux40/.cshrc
-
Linking to the login files with the @sys variable
Now that all the files are in the proper locations, create the links that will make it all work.
From your login directory do the following:
ln -s logins/@sys/.login .login ln -s logins/@sys/.cshrc .cshrc
You now have used the @sys variable to link to the proper .login and .cshrc files. When you log into a particular machine, the @sys variable will contain the proper sysname and therefore run the correct setup files. For instance, if we log into the Ultrix front end, the @sys variable will be set to alpha_dux40, so the login files in the directory logins/alpha_dux40 will be used.